To install wordpress, we must first create a a database and a user for that database. We can do this by loging into phpmyadmin. When you do so, go in to sql view and enter the following but making sure to change the YOURPASSWORDHERE for a password of your choice:
CREATE DATABASE WordPress; CREATE USER 'WordPress'@'localhost' IDENTIFIED BY 'YOURPASSWORDHERE'; GRANT ALL PRIVILEGES ON * . * TO 'WordPress'@'localhost' IDENTIFIED BY 'YOURPASSWORDHERE' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; GRANT ALL PRIVILEGES ON `WordPress` . * TO 'WordPress'@'localhost';
Once you have done this, you can go back in to ubuntu terminal and start the download of WordPress. We will be downloading and installing to site1.com. Put this where you would like it to be hosted.
cd /var/www/site1.com wget http://wordpress.org/latest.tar.gz
When the file has finished downloading, we will need to extract it. we do so with this command
tar -xzvf latest.tar.gz
This will leave you with a folder called wordpress. We now need to go in to that folder and move it to the correct directory. We can do this with the following command.
cd /var/www/site1.com/wordpress mv * /var/www/site1.com rmdir /var/www/site1.com/wordpress cd /var/www/site1.com rm latest.tar.gz sudo chmod 777 -R /var/www/*
What this does is it moves everything from the wordpress directory to the parent directory. It then deletes the wordpress directory and the rm latest.tar.gz file. We have also set the permissions so wordpress can edit the files in site. Now we can open up site1.com and configure wordpress.
When you go through the configuration process, it should look a little like this:
It should then have created the configuration file. You should now see a button to start the install:
Fill in the the form with all of the information about your new site… Your almost done! The only thing left we should do now is to set the ftp details so that you can install new things on your site. To do this, we first need to log in to phpmyadmin and create a user in our ftp database. We can do this by going in to the sql view and entering the following:
INSERT INTO `pureftpd`.`ftpd` ( `User` , `status` , `Password` , `Uid` , `Gid` , `Dir` , `ULBandwidth` , `DLBandwidth` , `comment` , `ipaccess` , `QuotaSize` , `QuotaFiles` ) VALUES ( 'WordPress', '1', MD5( 'password' ) , '2001', '2001', '/var/www/site1.com', '0', '0', '', '*', '0', '0' );
Now that WordPress has its own ftp user, we will need to edit the wp-config.php file. We will do this through the terminal.
If you then scroll down to the bottom and add the following lines of code then you should now be done.
define('FTP_USER', 'WordPress'); define('FTP_PASS', 'password'); define('FTP_HOST', 'localhost');
After you have saved and closed that, assuming you have done everything else specified in this guide then you should have everything sorted and your new website should be perfect.