How to build your personal website? Use WordPress and VPS step by step (2)

  • LAMP environment to build

Before you build WordPress in your VPS, you need to build LAMP first.

LAMP is an archetypal model of web service stacks, named as an acronym of the names of its original four open-source components: the Linux operating system, the Apache HTTP Server, the MySQL relational database management system (RDBMS), and the PHP programming language.

I recommend you to use LNMP software bundle

# screen -S lnmp

Press Enter then

# wget -c ftp://soft.vpser.net/lnmp/lnmp1.3-full.tar.gz && tar zxf lnmp1.3-full.tar.gz && cd lnmp1.3-full && ./install.sh lamp

 

First, you need to set up a ROOT passcode for your database, it is very important. Remember this password.

Next, you need choose some number to install, I recommand you to choose Defaut.

When green words “Press any key to install…or Press Ctrl+c to cancel” shown, press Enter to continue. Wait about 30 minutes, you will see:

Congratulations! LAMP exist in your VPS!Optimize VPS Before install WordPress

I recommend you to install OPcache and Memcached to optimize your VPS before install WordPress. It is great benefit. to reduce the VPS pressure and improve the speed to access WordPress.

Type:

# cd /root/lnmp1.3-full

./addons.sh install opcache

Press Enter key twice. When “Opcache installed successfully, enjoy it!” displayed, indicates that the installation was successful.

Next, install Memcached:

# ./addons.sh install memcached

 

Press Enter key, choose 2, press enter key again.

When “Opcache installed successfully, enjoy it!” displayed, indicates that the installation was successful.

Then you can add domain name and install WordPress.

  • Add domain name and install WordPress

# lnmp vhost add

Press Enter key and input your domain.

Press Enter key and input y

Then press your domain with www

Press Enter key. Use default directory setting.

Input

# n

Press Enter key, then type your e-mail.

Press Enter key, and Input

# y

Press Enter key, and Input your database password

Press Enter key, Input your database’s name, such as

# duckystory

Press Enter key, setup your database’s password, such as

# duckystory

Press Enter key twice.

When information displayed like this, indicates that the domain addition was successful.

  • Install WordPress

First, go to your site directory

#  cd /home/wwwroot/duckystory.com

Then type

# wget https://wordpress.org/latest.tar.gz

Press Enter key and unpack

# tar -zxvf latest.tar.gz

Press Enter key.

Next, move files in wordpress directory to Parent directory (do not forget . ) and delete empty wordpress directory.

# mv wordpress/* .

Press Enter key.

# rm -rf wordpress

Press Enter key.

In order to avoid problems due to permission to install failed, it is recommended to give writable permissions to the root directory.

# chmod -R 755 /home/wwwroot

Press Enter key

# chown -R www /home/wwwroot

Press Enter key

You need also turn on scandir function to avoid some trouble.

# vi /usr/local/php/etc/php.ini

Press Enter key and search scandir function.

# ?scandir

Press i and delete character ,scandir then press esc key, and

# :wq

Press Enter key

Then

# lnmp restart

Finally, use you browser to open your domain carry out the final operation!

 

Posted in How to.

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *