Tuesday, August 28, 2012

Setup web server in Fedora

1. Make sure you install httpd server on the system.
  • rpm -qa | grep httpd         - This shows the list if you already have httpd installed on your system
2. If not installed, you may use:
  • yum install httpd          - download and install httpd server. 
    • to switch to root user: type "su" and provide Password when asked
3. Once the installation is complete, verify the test page: http://localhost
4. Create "/mywebsite" folder to organize your static web contents
5. Give apache server a readonly access to "/mywebsite" and its subfolders:
  • semanage fcontext -a -t httpd_sys_content_t "/mywebsite(/.*)?"
follow here to complete the changes: http://docs.fedoraproject.org/en-US/Fedora/13/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Configuration_examples.html#sect-Managing_Confined_Services-Configuration_examples-Running_a_static_site