Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Install WordPress in vps
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Install WordPress in vps

toshosttoshost Member, Host Rep
edited March 2014 in Tutorials

Hello all
This is a start up tutorial for newbie only. Today i will try to show a small tutorial about new vps setup with wordpress.

1st you need a vps with Root access . (no need any control panel)

STEP 1: INSTALL REMI/EPEL REPOSITORY


Use one of below commands as per your OS version and system architecture.
CentOS/RHEL 6, 32 Bit:

CentOS/RHEL 6, 64 Bit:

CentOS/RHEL 5, 32 Bit:

CentOS/RHEL 5, 64 Bit:

STEP 2: INSTALL APACHE



After adding EPEL and Remi repository in vps. Lets use following command to install latest available Apache package.

yum --enablerepo=remi install httpd


After installing Apache, start Apache service using following command and enable auto start on system reboot.

service httpd start
chkconfig httpd on

STEP 3: INSTALL MYSQL


Lets install MySQL server and client using yum package manager with following command.

yum --enablerepo=remi install mysql mysql-server


After installing MysQL server packages, start the service and execute following command for applying initial security.

service mysqld start

/usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current

password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorization.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y

... Success!

Disallow root login remotely? [Y/n] y

... Success!

By default, MySQL comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y

  • Dropping test database...
    ... Success!

  • Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

... Success!

All done! If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

Cleaning up...

STEP 4: INSTALL PHP



After comleting installation of Apache and MySQL finally we need to install PHP. Use the following command to install latest PHP version.

yum --enablerepo=remi install php php-common



Also install required PHP libraries used for your application, Few of useful libraries are listed below.

yum --enablerepo=remi install php-common php-cli php-mysql php-devel

STEP 5: START SERVICES



Finally start Apache and MySQL services using following commands and setup them to auto start on system boot.

service httpd restart
chkconfig httpd on
service mysqld restart
chkconfig mysqld on

STEP 6: DOWNLOAD WORDPRESS


Download WordPress archive file using wget command

cd /var/www/html
wget http://wordpress.org/latest.tar.gz



Extract archive in document root of you domain and update permissions on files.

tar xzf latest.tar.gz
chown -R apache.apache wordpress
chmod -R 755 wordpress

STEP 7: CREATE MYSQL DATABASE AND USER


After extracting code we need to create a mysql database and user account for configuring WordPress. Use following set of command to do it

mysql -u root -p

Enter password:

mysql> CREATE DATABASE wordpress;

mysql> GRANT ALL ON wordpress.* to 'wordpress'@'localhost' IDENTIFIED BY 'secret_password';

mysql> FLUSH PRIVILEGES;
mysql> quit

STEP 8: CONFIGURE APACHE VIRTUALHOST


Edit apache configuration file and add a new virtual host for WordPress setup like below.

nano /etc/httpd/conf/httpd.conf

Add following setting at end of file

ServerAdmin [email protected]

DocumentRoot /var/www/html/wordpress

ServerName wordpress.yourdomain.com

ErrorLog logs/wordpress.yourdomain.com-error_log

CustomLog logs/wordpress.yourdomain.com-access_log combined

Reload Apache service to read configuration file again.

service httpd reload

STEP 9: FINISH INSTALLATION USING WEB INSTALLER



WordPress provides an web installer for easy to setup WordPress without editing files manually. After completing above steps just point your browser to your domain.Open URL in Browser and Click on Create a configuration file.
That’s all !!

«1

Comments

  • at step #3, this is the command to run mysql secure installation
    mysql_secure_installation

  • toshosttoshost Member, Host Rep

    @namhuy said:
    at step #3, this is the command to run mysql secure installation
    mysql_secure_installation

    Thanks. added :)

  • The difference between PHP as CGI or a module is fairly small in comparison to the insane number of MySQL queries needed to serve a wordpress page.

    Thanked by 1Lee
  • AbdussamadAbdussamad Member
    edited March 2014

    amarc said: I was referring to security not performance..

    mod_php is more secure on single user servers.

  • AbdussamadAbdussamad Member
    edited March 2014

    ricardo said: The difference between PHP as CGI or a module is fairly small in comparison to the insane number of MySQL queries needed to serve a wordpress page.

    Do you have any stats comparing WP with other CMS with regard to number of queries?

  • No, and I'm not going to convince you wordpress is good or bad compared to other CMS' either- I was making a direct reference to the performance of wordpress compared to simply serving a static page.

  • @amarc said:
    When I see in 2014 that people still run PHP as Apache I want to kill puppie..

    whats wrong with apache and what do you recommend ?

  • tchentchen Member

    @amarc said:
    There is everything wrong running PHP as root (in a way..)

    Aside from perhaps the php master process in php-fpm, is it even defaulted to do that nowadays in the common distros?

  • amarc said: it's part of Apache project and while it does require root privileges to change to user X it only requires it in that part of whole story.

    mod_php is the same. Only the Apache parent process runs as root. Child processes run as www-data or whatever you've set it to.

  • thanks man :)

  • VPNVPN Member
    1. Install LAMP
    2. Download and extract wordpress.zip to htdocs
    3. Win.
    Thanked by 1Droidzone
  • BruceBruce Member

    STEP 3 - Setup Database

    You can install MySQL or MariaDB. Both work. Some people prefer MariaDB

    Repos are listed here: https://downloads.mariadb.org/mariadb/repositories/#mirror=somerset

  • thanks for tutorial

  • BayuBayu Member

    ada bang @jenglotbae juga

  • easyeasy Member

    debian tutor?

  • Next up... How to secure your server

  • Good tutorial. thanks :)

  • @PremiumN said:
    Next up... How to secure your server

    Check out the "Secure VoIP Server" link in my signature. In that article I had compiled many IPTables rules that I found useful for server security over the years. You can ignore the Asterisk section there.

  • What about minimum system requirements for apache + sql + wordpress?

  • @zerriath said:
    What about minimum system requirements for apache + sql + wordpress?

    I use nginx + mysql + postfix + dovecot with 1 wordpress page and my vps is at 86MB RAM consumption

  • @zerriath said:
    What about minimum system requirements for apache + sql + wordpress?

    If you're using a OpenVZ VPS, you could easily run this with 256MB of RAM. I would recommend using MariaDB though, as it seems to use less memory.

  • @amarc Both Apache and Nginx work well. I don't see any difference and I'm using both of them.

  • If you don't need Apache stick with Centmin Mod and enjoy the mix (Nginx+Mariadb+php-fpm)!!!

    Thanked by 1bersy
  • frankfrank Member
    edited November 2014

    Or if you are on Debian based OS, use EasyEngine; its a fully optimized Wordpress build using Nginx

    https://rtcamp.com/easyengine/

    And its so simple even complete linux novices can use it

  • Another simple (alternative) way to install epel repo using yum :

    yum install epel-release

  • @4n0nx said:
    I use nginx + mysql + postfix + dovecot with 1 wordpress page and my vps is at 86MB RAM consumption

    Care to share how you setup that? How many visitors do you get?

  • LEB + LEMP, not LAMP

  • raindog308raindog308 Administrator, Veteran

    c1bl said: @amarc Both Apache and Nginx work well. I don't see any difference and I'm using both of them.

    Nginx is more performant. However, Apache is the swiss army knife. It really depends on what you need.

    If you're serving a small number of concurrent users, you likely won't see a difference. nginx probably uses less memory.

    I find nginx easier to setup, but Apache supports .htaccess and there are endless books, tutorials, etc.

    I suspect nginx is more secure but have no proof. However, he written-from-scratch OpenBSD webserver (httpd, comes with the base OS) is very nginx-like :-)

  • raindog308raindog308 Administrator, Veteran

    BTW, the venerable LEAdmin's tutorial on running web servers on LEBs includes setting up wordpress and mysql...on a 64mb:

    http://lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/

    BTW, doesn't Wordpress support sqlite? I suspect you'd need to have a lot of concurrent commenting going on before you'd see the benefit of MySQL. Then again I wouldn't be surprised if you didn't find some WP bugs, as a lot of projects test only php+mysql on Linux.

    Thanked by 1vRozenSch00n
Sign In or Register to comment.