Dysmey Post > Projects & Stuff > Janovac > Web
The Web Server option in the Fedora installation includes the Apache Web server and the PHP scripting language. Although other Web servers are available, Apache and PHP are selected for installation by default.
Apache is listed among the startup services, but is not launched by default. This is because Apache's configuration file, httpd.conf in the folder /etc/httpd/conf, must be set up first.
The Apache configuration file uses variables called directives to set up how the Web server runs and where the Web site and its pages are. The paramount directives (to me) are these.
directive | description | default |
---|---|---|
Listen | The port that Apache gets its HTTP information from. | 80 |
ServerAdmin | Server administrator's e-mail address. | root@localhost |
ServerName | The name (or URL) of the Web site, optionally including its port. | server's hostname |
DocumentRoot | The folder in the server where the home page of the Web site is. | /var/www/html |
To change the configuration file:
Launch Firefox or some other Web browser. In the address bar type http://janovac. If you are successful, you should see the Fedora Test Page.
You are not ready to load your Web site yet, because in Fedora's eyes you do not own the Web folder /var/www/html and its contents. This needs to be fixed first.
The chown step assigns ownership of the /var/www/html folder and all its contents to your account. The chmod step gives you the ability to read and write files in /var/www/html. This is necessary to be able to edit the Web site from a Windows box, logged in to your account using Samba.
You can now load the Web site onto /var/www/html. Navigate to the root folder of the Web site on its backup medium (in Fedora, /media/diskname/ξ, where ξ is the root folder), and run cp -R . /var/www/html
If Apache is running, so is PHP. Finding out whether PHP is working is simple: In /var/www/html create or load a file named phpinfo.php with just one line: <?php phpinfo(); ?>
. You should see a long informational page when you visit phpinfo.php on your Web browser. Seeing the one-liner only means that something is wrong with PHP.