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

php increase max file size upload

For increase maximum size of uploads file you should set only one setting in php.ini. Set...

Changing ssh port

How to change ssh port. Open the file /etc/ssh/sshd_config with your favourite text...

Centos 6 Webserver

In this article we will install some software that is useful on a webserver based on...

Usefull linux tools

please note: for installing some toosl you ned to connect EPEL repo first. htop -extened version...

Disabling selinux

Selinux annoying you? Get it out! How to disable selinux Open its config file nano...