How To Install WordPress On Ubuntu 14.04
January 4, 2018
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04If you have not already setup a database, follow the link above for instructions. Otherwise, log in to phpmyadmin and setup a database for the wordpress install.
cd ~
wget http://wordpress.org/latest.tar.gzextract the files:tar xzvf latest.tar.gzthi will create a directory called wordpress in the home directory.sudo apt-get install php5-gd libssh2-phpcd ~/wordpresscp wp-config-sample.php wp-config.phpnano wp-config.phpfille in the values for ‘DB_NAME’, ‘DB_USER’ and ‘DB_PASSORD’After you close the file, copy the files to the document root:sudo rsync -avP ~/wordpress/ /var/www/html/… or create another directory after /html/ to copy files to a subdirectory. Example:sudo mkdir /var/www/html/homethen:sudo rsync -avP ~/wordpress/ /var/www/html/home/move into the directory:cd /var/www/html/homechange ownership properties, where user below is the user:sudo chown -R user:www-data *manually create the uploads folder beneath the wp-content directory:mkdir /var/www/html/home/wp-content/uploadssudo chown -R :www-data /var/www/html/home/wp-content/uploadsNow you can complete the installation by going to the ip address of the install…http://server_dmain_name_or_IPAfter wordpress is installed, we modify apache to allow URL rewrites:sudo nano /etc/apache2/sites-available/000-default.confhere we set the ServerName and create a directory section where we allow overrides:<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName server_domain_name_or_IP
<Directory /var/www/html/>
AllowOverride All
</Directory>
. . .sudo a2enmod rewritesudo service apache2 restartcreate an .htaccess file:touch /var/www/html/home/.htaccesssudo chown :www-data /var/www/html/home/.htaccesschmod 664 /var/www/html/home/.htaccessNow in wordpress settings, we can got to ‘Settngs’ > ‘Permalinks’ and choose settings as necessary
Posted in Tutorials
Can you write a tutorial on how to install nginx on a local server instead of apache?
Yes I will. Actually, if you will be working with nginx on your production site, you should also do the same for your local dev environment (Both local and production servers should be identical). I used this install for 14.04 before 16.04 was released and have yet to update it. I will update this post soon to reflect nginx and ubuntu 16.04. Note that after you have done these steps a few times, it will probably become somewhat tedious to have to type in all of these commands each time you want to spin up a new local server. I will eventually post a tutorial on how to create a vagrant base box where everything is already installed – and you can even share the boxes to others so everyone is working in the same environment.