Skip to content

Instantly share code, notes, and snippets.

@nickfox-taterli
Last active April 3, 2021 10:34
Show Gist options
  • Save nickfox-taterli/2c283d73ba817392fb0f9f15d9cfa514 to your computer and use it in GitHub Desktop.
Save nickfox-taterli/2c283d73ba817392fb0f9f15d9cfa514 to your computer and use it in GitHub Desktop.
Gullo.me 128MB VPS WordPress Install Script
apt-get update
systemctl disable getty@tty1.service
systemctl disable getty@tty2.service
apt-get -y remove --purge rsyslog
apt-get -y install ca-certificates dash inetutils-syslogd
rm -f /bin/sh
ln -s dash /bin/sh
#chsh -s /bin/dash
invoke-rc.d inetutils-syslogd stop
for file in /var/log/*.log /var/log/mail.* /var/log/debug /var/log/syslog
do
[ -f "$file" ] && rm -f "$file"
done
for dir in fsck news
do
[ -d "/var/log/$dir" ] && rm -rf "/var/log/$dir"
done
cat > /etc/syslog.conf <<END
*.*;mail.none;cron.none -/var/log/messages
cron.* -/var/log/cron
mail.* -/var/log/mail
END
[ -d /etc/logrotate.d ] || mkdir -p /etc/logrotate.d
cat > /etc/logrotate.d/inetutils-syslogd <<END
/var/log/cron
/var/log/mail
/var/log/messages {
rotate 4
weekly
missingok
notifempty
compress
sharedscripts
postrotate
/etc/init.d/inetutils-syslogd reload >/dev/null
endscript
}
END
invoke-rc.d inetutils-syslogd start
sed -i 's/\Port 22/\Port 20100/' /etc/ssh/sshd_config
service sshd restart
apt-get install -y dropbear
sed -i 's/\NO_START=1/\NO_START=0/' /etc/default/dropbear
apt-get -y remove --purge openssh-server
echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list
echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list
wget https://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg
rm dotdeb.gpg
apt-get update
apt-get -y install php7.0-cgi php7.0-sqlite3 unzip
apt-get -y install sqlite lighttpd
sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/cgi/php.ini
sed -i s/'memory_limit = 128M'/'memory_limit = 32M'/ /etc/php/7.0/cgi/php.ini
cd /etc/lighttpd/conf-enabled
cp ../conf-available/*fastcgi* .
sed -i 's/\PHP_FCGI_CHILDREN" => "4"/\PHP_FCGI_CHILDREN" => "1"/' 15-fastcgi-php.conf
cd /var/www/html
wget http://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
rm index.lighttpd.html
rm latest.tar.gz
mv wordpress/* .
rm wordpress -r
wget http://downloads.wordpress.org/plugin/sqlite-integration.1.8.1.zip
unzip sqlite-integration.1.8.1.zip
mv sqlite-integration wp-content/plugins
cp wp-content/plugins/sqlite-integration/db.php wp-content/
rm sqlite-integration.1.8.1.zip
cp wp-config-sample.php wp-config.php
sed -i /database_name_here/s#^#//# wp-config.php
sed -i /username_here/s#^#//# wp-config.php
sed -i /password_here/s#^#//# wp-config.php
sed -i /localhost/s#^#//# wp-config.php
#echo "define('DB_FILE', 'wp_db');" >> wp-config.php
#echo "define('DB_DIR', '/var/www/html/db/');" >> wp-config.php
#mkdir -p /var/www/html/db
chown www-data:www-data * -R
@jessuppi
Copy link

Hello Tater, very nice script here. I was wondering what specifically makes your script work well on 128MB servers?

If you have any suggestion for our SlickStack script, I would really appreciate it:

https://github.com/littlebizzy/slickstack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment