Thank GNUtransfer the loan us a VPS and other resources to write this article.
In this article we will see how to install WordPress on a VPS or a dedicated server.
For our article we will use the domain example.geeklab.com.ar and our IP is 69.61.93.19
We start from a minimal install of Debian Wheezy or Ubuntu Precise Pangolin.
First we need to install the necessary packages, apache2, libapache2-mod-php5, php5, php5-curl, php5-intl, php5-mcrypt, php5-mysql, php5-sqlite, php5-xmlrpc, mysql-server, mysql-client
root@x19:/# apt-get install apache2 libapache2-mod-php5 php5 php5-curl php5-intl php5-mcrypt php5-mysql php5-sqlite php5-xmlrpc mysql-server mysql-client Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common ca-certificates libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libcap2 libcurl3 libdbd-mysql-perl libdbi-perl libhtml-template-perl libicu48 libldap-2.4-2 libltdl7 libmcrypt4 libmysqlclient18 libnet-daemon-perl libplrpc-perl librtmp0 libssh2-1 mysql-client-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 Suggested packages: www-browser apache2-doc apache2-suexec apache2-suexec-custom php-pear libipc-sharedcache-perl libmcrypt-dev mcrypt libterm-readkey-perl tinyca The following NEW packages will be installed: apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common ca-certificates libaio1 libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libcap2 libcurl3 libdbd-mysql-perl libdbi-perl libhtml-template-perl libicu48 libldap-2.4-2 libltdl7 libmcrypt4 libmysqlclient18 libnet-daemon-perl libplrpc-perl librtmp0 libssh2-1 mysql-client mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5 php5 php5-curl php5-intl php5-mcrypt php5-mysql php5-sqlite php5-xmlrpc 0 upgraded, 39 newly installed, 0 to remove and 0 not upgraded. Need to get 19.9 MB of archives. After this operation, 137 MB of additional disk space will be used. Do you want to continue [Y/n]?
We ask that we enter a password for the root user of mysql
We are asked again to confirm the password for the root user of mysql
Now proceed to configure Apache will use as working directory /var/www/wordpress
first create the directory
root@x19:/# mkdir -p /var/www/wordpress
Then create the file /etc/apache2/sites-available/wordpress with the following content
Note: You must change the IP, domain and email address through which they belong.
NameVirtualHost 69.61.93.19:80 <VirtualHost 69.61.93.19:80> ServerAdmin rmalvarez@gnupanel.org ServerName example.geeklab.com.ar DocumentRoot /var/www/wordpress <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Then we disable the default site configured in apache and wordpress put a site we’ve added recently, stop that run the following commands
root@x19:/# a2dissite default Site default disabled. To activate the new configuration, you need to run: service apache2 reload root@x19:/# a2ensite wordpress Enabling site wordpress. To activate the new configuration, you need to run: service apache2 reload root@x19:/#
Also edit /etc/hosts and where our IP will also add our domain
root@x19:/# cat /etc/hosts 127.0.0.1 localhost 69.61.93.19 example.geeklab.com.ar x19 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts root@x19:/#
And in the file /etc/apache2/ports.conf comment the line NameVirtualHost *:80 so that it looks like
root@x19:/# cat /etc/apache2/ports.conf # If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default # This is also true if you have upgraded from before 2.2.9-3 (i.e. from # Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and # README.Debian.gz #NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> root@x19:/#
Then add the apache rewrite module
root@x19:/# a2enmod rewrite Enabling module rewrite. To activate the new configuration, you need to run: service apache2 restart root@x19:/#
Then optimize PHP to suit the needs of wordpress
NOTE: This is not the optimal configuration, just put on estimated values to make sure that wordpress work properly for each particular installation should tune this setting.
Edit /etc/php5/apache2/php.ini and modify the following variables so they are with the following values.
max_execution_time = 900 max_input_time = 900 memory_limit = 512M post_max_size = 64M upload_max_filesize = 64M max_file_uploads = 32 default_socket_timeout = 900
We proceed to restart apache
root@x19:/# /etc/init.d/apache2 restart [ ok ] Restarting web server: apache2 ... waiting . root@x19:/#
Now we connect to mysql and create database and user mysql for wordpress
for that first we connect to mysql
root@x19:/# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 42 Server version: 5.5.30-1.1 (Debian) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
And now create the database and user with these statements
NOTE: In our example both the database and the user are wordpress, replace the password PASSWORD_DB who wish to assign to the database.
mysql> CREATE DATABASE wordpress; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL ON wordpress.* TO wordpress@localhost IDENTIFIED BY 'PASSWORD_DB'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> \q Bye
We now proceed to download wordpress, we make sure to install wget and then proceed to the download
root@x19:/# apt-get install wget Reading package lists... Done Building dependency tree Reading state information... Done wget is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. root@x19:/# root@x19:/# cd /tmp root@x19:/tmp# root@x19:/tmp# wget --content-disposition http://wordpress.org/latest.tar.gz --2013-04-19 01:30:34-- http://wordpress.org/latest.tar.gz Resolving wordpress.org (wordpress.org)... 72.233.56.139, 72.233.56.138 Connecting to wordpress.org (wordpress.org)|72.233.56.139|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/x-gzip] Saving to: `wordpress-3.5.1.tar.gz' [ <=> ] 5,012,722 1.03M/s in 4.6s 2013-04-19 01:30:40 (1.05 MB/s) - `wordpress-3.5.1.tar.gz' saved [5012722] root@x19:/tmp#
Uncompress it and make sure to change the permissions so that no conflicts
root@x19:/tmp# tar -C /var/www -xf wordpress-3.5.1.tar.gz root@x19:/tmp# root@x19:/tmp# chown -R www-data:www-data /var/www root@x19:/tmp# find /var/www -type f -exec chmod 0600 {} \; root@x19:/tmp# find /var/www -type d -exec chmod 0700 {} \; root@x19:/tmp#
Now we turn to the browser to our site to use wordpress installer, in the example http://example.geeklab.com.ar and follow the steps.
Step 1
Step 2
Step 3, Here we put database conection data.
Step 4
Step 5, Here we put the basic data from our blog
Step 6
This completes the installation of wordpress on a Debian Wheezy installation with the minimum to run

About Ricardo Marcelo Alvarez
- Web |
- More Posts(58)