Web server

In this guide we will create our own web server on Centos 6. 

We will use Apache (httpd with mysql and php -most common needs for most CMS) as web server and it's necessary to install mysql and php. So, let's install packets:

yum install httpd httpd-devel php php-mysql mysql

Set Apache to autostart at boot:

chkconfig httpd on

You can print installed httpd modules with the command httpd -l:

[root@webserver]# httpd -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

Start apache:

service httpd start

Apache config file: /etc/httpd/conf/httpd.conf

Default location for web pages: /var/www/html/
So if you have a site on local machine in folder "mysite" and you want to put it on the web server you must copy the files (not the directory) in /var/www/html/.
Now you can open your browser and go to your webpage http://yourwebserver.domain/

 

Was this answer helpful?

 Print this Article

Also Read

Autorun in Linux

To set a script to start at boot in CentOS, add it into /etc/rc3.d/S99local. For example:...

Security tips for Linux server

1. Use only  strong passwords for all accounts , especially for root. Always use a secure root...

Backup script sample

#!/bin/bash echo "packing files in progress..." tar -cf /home/backup/root_lib-$(date...

Pptpd on Centos 6

How to install pptpd server on Centos 6 NOTE than pptpd is potentially unsecure and the tunnel...

Forward (redirect/nat) traffic with iptables

If you want to redirect/nat some traffic to IP 2.2.2.2 via IP 1.1.1.1, it simply can be done...

Powered by WHMCompleteSolution