WordPress is best known for hosting service available through blogs http://wordpress.org/, but it is actually a content manager for general use, that can be installed on any server that supports PHP and MySQL licensed under the GPL, and source code is available and can be customized freely.
You can even install it at home to play and test the functions, need to have a pre-configured LAMP server. If you do not know what I mean, here’s a brief explanation:
Apache continues to provide only static HTML pages. When prompted for a page in PHP or another language, kicks in the appropriate module, which makes the necessary processing and returns to the Apache html page that appears. The content managers and boards then come into play, which combine the features of PHP with a database like MySQL, accessed through it. The combination of all this as the solution that is popularly called ” LAMP “( Linux Apache MySQL PHP ).
The possibility of running WordPress on your own server is not only interesting if you are interested in using the system on your own site or a site that manages, but also for dedicated server hosting companies in general, which may offer installation and administration Content Manager as an additional service. You can download the installation package from the official website.
To install, copy the package files to the folder of the web server and unzip it using “unzip” (if it is not available, install the package “unzip” using the package manager), as in:
$ Unzip latest.zip
This will create the “wordpress” folder in the folder where you unzipped the file, creating the url ” http://server/wordpress . ” If you want the manager to be available in another folder on the server, just rename it before proceeding, using the mv command, as in:
Mv wordpress blog
If you prefer to make it available through the root URL of the site, move all files within the folder to the root directory of the site.
Just like phpBB, WordPress requires a database and a user access to the MySQL server you can add them quickly through the MySQL prompt, using the commands we’ve seen before:
$ Mysql-u root-p
mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL ON wordpress;
mysql> FLUSH PRIVILEGES;
The next step is to adjust the configuration of WordPress so that it uses the database created. For this, the first step is to access the root folder and rename the file “wp-config-sample.php” to “wp-config.php”, as in:
$ Cd wordpress
$ mv wp-config-sample.php wp-config.php
Open the file using a text editor and set any options for the database, adding the database, user and password created:
/ / ** MySQL settings ** / /
define (‘DB_NAME’, ‘ wordpress ‘); / / The name of the database
define (‘DB_USER’, ‘ wordpress ‘); / / Your MySQL username
define (‘db_password’ ‘ 8oNqrQsh ‘) / / … and password
define (‘DB_HOST’, ‘localhost’) / / 99% chances are, you will not need to change this value
The “DB_HOST” indicates the address of the MySQL server used. Except where you are using separate servers for the function of web server and database, we use “localhost” or “127.0.0.1″ that guide the system to contact a MySQL server running on the same machine.
A curiosity is that the file “wp-config.php” gets with read permission for everyone. However, if you try to access it directly from the browser (http://my-site/wordpress/wp-config.php), or try to download it from another machine using wget (or other download manager) will realize that the system always delivers an empty file instead of displaying the passwords. This is because of the extension. “Php”, the web server always processes the file using the PHP interpreter, without displaying it directly. A PHP function within the file then takes care of showing the blank page instead of displaying the configuration information.
Continuing, after setting up the file, just complete the installation by accessing the script via browser “wp-admin/install.php” folder inside the installation of WordPress, as in ” http://mydomain/wordpress/wp-admin/install.php “or” http://mydomain/wp-admin/install.php . ”
The installer asks only the title of your blog and e-mail contact. By clicking the “Install WordPress” the installation is completed automatically:
Thereafter, the remaining steps are done through the WordPress admin interface, available via the folder “wp-admin” in the installation directory, as in ” http://mydomain/wordpress/wp-admin/ . ” Simply login using the password created during installation:
This post is intended for programmers developing projects with PHP but have not been encouraged to install GNU / Linux.
Not to lose focus on what we need, conserve resources and minimize the administration, we always recommend a minimal installation of Debian and then we’ll install the rest.
After installing the operating system to install APACHE proceed with MySQL and PHP:
# Apt-get install apache2 php5 libapache2-mod-php5 mysql-server php5-mysql phpmyadmin
The root-folder of the webserver is in / var / www / but you can change or set up links, a task that is a bit more advanced.
The next step is to configure the firewall, if the computer is accessible from the Internet or a network with many computers. The same is not restrictive (all traffic is denied unless you explicitly allow) but permissive.
# / Bin / bash PATH = / usr / sbin: / sbin: / bin: / usr / bin # change eth0 for the local interface in the case of another LAN = “eth0″ # ——– INITIALIZATION ———— ——————– iptables-F iptables-t nat-F iptables-t mangle-F iptables – X # ———————– ———————– LOOPBACK iptables -A INPUT-i lo-j ACCEPT # —————— —————– iptables FILTER PACKAGES – A INPUT-m state – state ESTABLISHED, RELATED-j ACCEPT iptables-A INPUT-m state – state NEW-i! eth1-j ACCEPT # ————————- ——————- ROUTING —– echo 1> / proc/sys/net/ipv4/ip_forward # ————————- —– SSH ——————- $ IPTABLES-A INPUT-i $ LAN-p tcp – dport 22-j ACCEPT # ———– ———————— ————– HTTP $ IPTABLES-A INPUT-i $ LAN-p tcp – dport 80-j ACCEPT
A script should give an execute permissions:
chmod 744 firewall
Now we can add it in two places: the system start or in the folder / etc / network / if-up (run whenever the system detects that a network interface up a link.)
For this example we will assign within the system boot sequence. For that you must copy the script to the folder / etc / init.d / and create links to it in each init.
cp firewall / etc / init.d
update-rc.d firewall defaults 80
The php.ini file is a special file for suPHP (pronounced sue-p-h-p).
The php.ini file is where you declare changes to your PHP settings. You can edit the existing php.ini, or create a new text file in any subdirectory and name it php.ini. This file location depends on several things: if your are using Linux or Windows, where you installed your webserver, … the file is always located on the server where the scripts of Claroline will run.
PHP.ini is very useful and it is a configuration file that is used to customize behavior of PHP at runtime. This enables easy administration in the way you administer Apache web server using configuration files. The Settings in which upload directory, register global variables, display errors, log errors, max uploading size setting, maximum time to execute a script and other configurations is written in this file. The file is normally not editable to people who open an account in a host service, as it is common to several users hosted on the same machine. But you can normally easily see its content with this simple code added to the script of Claroline if you need to see the settings.
Some common changes that you must make when moving from non-secure php environment to suPHP:
For example, if your site had these settings in a .htaccess file:
php_flag upload_max_filesize 10M
php_value post_max_size 10M
php_value max_execution_time 30
SuExec users must put them in a php.ini file instead. Here is the proper syntax:
upload_max_filesize = 10M
post_max_size = 10M
max_execution_time
When PHP Server starts up it looks for PHP.ini file first to load various values for settings. If you made changes in PHP.ini then you need to restart your server to check the changes be effected. If you want to do some custom configurations then you can also write your own php.ini file. For this copy php.ini template file, make necessary changes in values directives according to your need rename it to php.ini then copy it to desired location in root of your web directory or in any particular folder. But hosting should allow for running this file.