Jump to content



Photo

Install Wordpress On Your VPS - Posted By Chester07

How To

  • Please log in to reply
13 replies to this topic

#1 Cryo Kinesis

Cryo Kinesis

    Haphost Staff

  • Moderators
  • 128 posts
  • LocationGridania, Eorzea

Posted 05 August 2014 - 05:57 PM

Hey guys Chester here and I will be doing a how-to install Wordpress on a VPS.

What you'll learn:
How to: 
Install: Nano (text editor)
VSFTPD (ftp server)
LAMP (software bundle)
PHPMyAdmin

LAMP stands for (L)inux (A)pache (M)ySQL (P)HP

This tutorial assumes that you already have basic knowledge about Ubuntu commands.

I will be using an Ubuntu 12.04 64-bit Minimal Template OS

So first, do an update!

sudo apt-get update

Once you've finished updating, we're going to install nano, which is a text editor program.
sudo apt-get install nano

Now that we have nano, let's go and install VSFTPD so that we can use an FTP client to connect, upload, or download files to and from our VPS.
sudo apt-get install vsftpd

Once you've installed that, it will automatically run using the default settings. To stop it, do:
sudo service vsftpd stop

Now that's VSFTPD is stopped, we can continue on editing the config file.
sudo nano /etc/vsftpd.conf

Ok so change these lines:

anonymous_enable=NO
^This prevents anonymous users from getting into our FTP.
local_enable=YES
^This allows local users to connect.
write_enable=YES
^This makes it possible for use to make files or directories via FTP.
connect_from_port_20=NO
^Port 20 need to turned off, makes vsftpd run less privileged.

Now do "Ctrl+O" and "Ctrl+X" to save and quit.
Ok so let's move on to making a user for vsftpd.

/var/www is the default directory for LAMP. Replace "ftpuser" with your desired username.
sudo useradd -d /var/www -s /usr/sbin/nologin ftpuser

Now we need to set a password for "ftpuser." To do that:
sudo passwd ftpuser

Ok so now give ftpuser the permission:
sudo chown -R ftpuser /var/www

Now that we're done with that, we need to make a userlist for vsftpd to recognize users.
sudo nano /etc/vsftpd.userlist
This will make a file called "vsftpd.userlist" in the directory "/etc/"

You will notice that the file is empty, go and add your username in there.
ftpuser
Then do "Ctrl+O" then "Ctrl+X."

Now go back to the vsftpd config file
sudo nano /etc/vsftpd.conf
and press Page Down until you reach the bottom. Now copy this:
# the list of users to give access
userlist_file=/etc/vsftpd.userlist
# this list is on
userlist_enable=YES
# It is not a list of users to deny ftp access
userlist_deny=NO
And paste it. To do that, right click.

Ok so we now have to configure the shells:
sudo nano /etc/shells
Press Page Down again and copy this:
/usr/sbin/nologin
and paste it.

We're done with the configuring stuff so now let's make a user group:
sudo addgroup ftpusers
and add ftpuser to that:
sudo usermod -Gftpusers ftpuser

Give yourself a pat on the back because we're done! (With the ftp part)
SOURCE: Noob2Geek (not allowed to post links)

Ok now to install LAMP

sudo apt-get install lamp-server^

Eventually, it will ask you for the MySQL "root" user password.
It takes some time for it to install it.

Now, let's go and install PHPMyAdmin
sudo apt-get install phpmyadmin

Soon, a screen will pop up. Just press SPACE and ENTER to select Apache and continue with the installation.
Another screen will pop up, just press ENTER to select Yes then it will ask for some passwords.

After that, installation is done! Next is making a MySQL database and user for Wordpress.
Go to:
<Your VPS' IP>/phpmyadmin
and login.

Click the Databases Tab and fill in the text box with the database name you want Wordpress to use then click Create. Now go and click the Previlages tab. Go and find the "Add a new user" link and click it. Fill in the text boxes and choose local for the host. Then scroll down and check the "Grant all previlages" and click Check All below it then click Create User.

Now we can focus on getting Wordpress into our server.
Go back to putty or whatever SSH client you use and type:
cd /var/www
This will send us to the main directory where we upload our files.

Now if you do
ls
You will see that there's a file call "index.html" we need to get rid of that.
rm index.html

Next, we need to download the latest Wordpress files. Go to Wordpress' website and find the link for latest.zip
wget <URL>
unzip latest.zip

After that unzips, it will extract a folder named wordpress. Now if you go to
<Your VPS' IP>/wordpress
You'll see the Wordpress installation. But if you want it on the root directory, you can do
mv <file1> <file2> <file3> <folder1> <folder2 <folder3> /var/www

Then continue on with the installation! That's it for this tutorial! If I missed anything, please feel free to tell me! If there's an easier way of doing something, go ahead and post it here!

Cryo%20Kinesis%20Haphost%20Sig2.png


#2 jesseke55

jesseke55

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 16 February 2015 - 12:31 PM

You missed 1 thing:

 

Making the www directory writable command: chmod -R 777 /var/www



#3 Bonar

Bonar

    Advanced Member

  • Members
  • PipPipPip
  • 181 posts
  • Location/home

Posted 16 February 2015 - 01:31 PM

You missed 1 thing:

 

Making the www directory writable command: chmod -R 777 /var/www

 

The writable /var/www to 777 is suitable only for hosting company which hosts many websites. If you run your server for your own, it does not necessary to do that. CMIIW


Nothing to display at the moment. RIP


#4 jesseke55

jesseke55

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 16 February 2015 - 02:31 PM

The writable /var/www to 777 is suitable only for hosting company which hosts many websites. If you run your server for your own, it does not necessary to do that. CMIIW

its just smart to make it writable for to generate an wp-config.php file and for permalinks an .htaccess AND the wp-content folder



#5 Bonar

Bonar

    Advanced Member

  • Members
  • PipPipPip
  • 181 posts
  • Location/home

Posted 16 February 2015 - 03:25 PM

its just smart to make it writable for to generate an wp-config.php file and for permalinks an .htaccess AND the wp-content folder

 

If you know how Unix systems manages files and folders, how the ownership works, you will not comment like this.

The last seven of "chmod 777" means it gives full authorization of any files and folders inside /var/www to everyone, read very carefully from the beginning.

The first 7 means full authorization to its owner.

The second 7 means full authorization to its group in which owner is joined.


Nothing to display at the moment. RIP


#6 xdmartinhi

xdmartinhi

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationAustria, Tirol

Posted 17 March 2015 - 08:08 PM

chown doesn't work!
he say that /var/www does not exist

#7 Andreas

Andreas

    Haphost Staff

  • Moderators
  • 283 posts
  • LocationGermany

Posted 17 March 2015 - 10:48 PM

chown doesn't work!
he say that /var/www does not exist

Then you probably don't have apache2 installed which created /var/www before.



#8 xdmartinhi

xdmartinhi

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationAustria, Tirol

Posted 22 March 2015 - 08:27 PM

Apt-get install lamp didn't work

#9 PatrickNL

PatrickNL

    Advanced Member

  • Members
  • PipPipPip
  • 115 posts
  • LocationIn a virtual world

Posted 22 March 2015 - 11:15 PM

Apt-get install apache2

or centos;
yum -y install httpd
  • jesseke55 likes this

#10 Andreas

Andreas

    Haphost Staff

  • Moderators
  • 283 posts
  • LocationGermany

Posted 27 March 2015 - 04:35 PM

Apt-get install lamp didn't work

LAMP stands for Linux Apache2 MySQL PHP, so if you want to have a LAMP server, you have to execute this command on Debian / Ubuntu:

apt-get install apache2 mysql-server php5


#11 xdmartinhi

xdmartinhi

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationAustria, Tirol

Posted 07 April 2015 - 08:14 AM

Ok but does this also work?

apt-get install taskel

taskel install lamp-server



#12 Andreas

Andreas

    Haphost Staff

  • Moderators
  • 283 posts
  • LocationGermany

Posted 07 April 2015 - 11:23 AM

It probably works too, but why installing Taskel, if it also works without?



#13 xdmartinhi

xdmartinhi

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationAustria, Tirol

Posted 07 April 2015 - 01:26 PM

yes but when in install lamp with taskel then i also install phpmyadmin etc. or?



#14 Andreas

Andreas

    Haphost Staff

  • Moderators
  • 283 posts
  • LocationGermany

Posted 07 April 2015 - 02:00 PM

Then just do

apt-get install phpmyadmin






Also tagged with one or more of these keywords: How To

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users