sourcecode

Showing posts with label Fedora. Show all posts
Showing posts with label Fedora. Show all posts

Thursday, June 28, 2012

Apache2 Configuration on Fedora Server for PHP

Get the install path of PHP(/usr/bin/php):
$>whereis php
and the path for php-cgi(/usr/bin/php-cgi):
$>whereis php-cgi

Edit the configuration file for apache2:
$>sudo vi /etc/httpd/conf/httpd.conf
insert the lines to accordance postions:
ScriptAlias /local-bin/ /usr/bin/

AddType applicatoin/x-httpd-php5 .php

AddHandler application/x-httpd-php5 php

Action application/x-httpd-php5 /local-bin/php-cgi

        Order allow,deny
        Allow from all
Finally reload apache:
$>sudo /usr/sbin/apachectrl restart
 /************END*****************/

Fedora run levels

http://www.techotopia.com/index.php/Configuring_Fedora_Runlevels_and_Services


  • Runlevel 0 - The halt runlevel. This is the runlevel at which the system shuts down. For obvious reasons it is unlikely you would want this as your default runlevel.
  • Runlevel 1 – Causes the system to start up in a single user mode under which only the root user can log in. In this mode the system does not start any networking, X windowing or multi-user services. This run level is ideal for system administrators to perform system maintenance or repair activities.
  • Runlevel 2 - Boots the system into a multi-user mode with text based console login capability. This runlevel does not, however, start the network.
  • Runlevel 3 - Similar to runlevel 2 except that networking services are started. This is the most common runlevel for server based systems that do not require any kind of graphical desktop environment.
  • Runlevel 4 - Undefined runlevel. This runlevel can be configured to provide a custom boot state.
  • Runlevel 5 - Boots the system into a networked, multi-user state with X Window System capability. By default the graphical desktop environment will start at the end of the boot process. This is the most common run level for desktop or workstation use.
  • Runlevel 6 - Reboots the system. Another runlevel that, for obvious reasons, you are unlikely to want as your default.


Testing:
[yguo@mo init.d]$ chkconfig --list sshd
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
[yguo@mo init.d]$ chkconfig --list httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
[yguo@mo init.d]$ chkconfig --list mysqld
mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off

So I set:
[yguo@mo init.d]$ sudo chkconfig --level 35 mysqld on
/************END*****************/