Installing an Apache server on Linux OS

Install Apache


Here we will learn how to install an Apache server.
Here are the steps

1) Download the latest version of Apache
wget http://apache.petsads.us//httpd/httpd-2.4.3.tar.bz2

2) Extract the archive: tar -jxvf httpd-2.4.3.tar.bz2

3) Now compile and install the Apache source code
Type this: cd httpd-2.4.3/
then create the directory of your Web server's public
sudo mkdir /var/www/
then installing Apache

./configure --prefix=/var/www --enable-module=so --enable-module=rewrite
sudo make && make install

4) Permissions
In general you should do this for the right server for your permission.

cd /var/www/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

and for the file to be executed:
chmod 755 /var/www/app/execute.exe

If you are on a Red Hat type distribution,
you should do that:

File and directory to read:
sudo chcon -Rt httpd_sys_content_t /var/www/html/

Directory to writing:
sudo chcon -Rt httpd_sys_content_rw_t /var/www/html/you-app/cache/

File to execute:
sudo chcon -t httpd_sys_script_exec_t /var/www/html/app/execute.exe

5) Finished!
Go on http://127.0.0.1 or http://localhost
Note: You can change the address of your local server in the Apache configuration file (httpd.conf).

Next entry

Previous entry

Similar entries

comments powered by Disqus