Web Hosting Talk







View Full Version : http.conf - php4


-Edward-
12-16-2000, 02:54 PM
Hi,

I'm having problems switching on php4 for one of my users. i type the following -

pico -w /etc/httpd/conf/httpd.conf

edit the section i want - Then after that i'm stuck. I dont know how to save this - I was told by felix to type -

hit X, then Y, then enter this:
/etc/rc.d/init.d/httpd restart
to restart Apache.

But where do i type this?. i've tryed right at the end of file that didnt work. Any ideas?.

webfors
12-16-2000, 03:33 PM
Technics,

In pico to save your work you hit "Control X" to exit, then "Y" to say YES to save the changes. That will bring you back to the shell prompt where you can type:

/etc/rc.d/init.d/httpd restart

To restart apache.

-Edward-
12-16-2000, 03:41 PM
[ Cannot open file for writing: Permission denied ]

I get this error even though i'm logged in as the system administrator.

webfors
12-16-2000, 03:44 PM
You usually only get this message if you're not logged in as root. Check again to make sure.

-Edward-
12-16-2000, 03:50 PM
[admin@www admin]$ - i see that how do i change it to root?.

webfors
12-16-2000, 03:52 PM
su -

and then enter the password for root. If you don't know or have the password, you'll have to get the person who does.

jtan15
12-16-2000, 03:56 PM
If you are on a Cobalt RaQ, the root password is generally the same as the admin password. Type in "su" then try the same password. If it lets you in, repeat everything that was posted.

-Edward-
12-16-2000, 04:10 PM
Think i boobooed.

I did the changes restarted apache and now i can't access any sites on the server. I can access anything behind port81 but on the normal port port 80 i get nothing.

I the control panel it says all services responding correctly - Yet there not.

Would restoring the http.conf file i downloaded before making any changes make any difference?.

Email - Ftp - Telnet all still work - Just having problems with the http://

[Edited by Technics on 12-16-2000 at 03:15 PM]

webfors
12-16-2000, 04:20 PM
Chances are you made a syntax error editing the httpd.conf file and apache refused to start.

Type:

/usr/local/apache/bin/apachectl configtest

(assuming that is where apache is installed on a RAQ)

That will scan your httpd.conf file for errors and let you know what they are.

-Edward-
12-16-2000, 04:23 PM
I realised id missed out a vital part of the code so i added it and now i get this -

[root@www admin]# /etc/rc.d/init.d/httpd restart
Shutting down Web Service:
Setting up Web Service: Syntax error on line 1 of /etc/httpd/conf/httpd.conf:
Invalid command 'pico', perhaps mis-spelled or defined by a module not included
in the server configuration
/usr/sbin/httpd

webfors
12-16-2000, 04:27 PM
It seems that you typed "pico" on the first line of httpd.conf

Open it up again, delete the first line, save it, and restart apache.

-Edward-
12-16-2000, 04:33 PM
Thanks for all your help Tabernack -

Now i have this problem -

[root@www admin]# /etc/rc.d/init.d/httpd restart
Shutting down Web Service:
Setting up Web Service: Site site1 has invalid certificate: 4999 Certificate fil
es do not exist.
Syntax error on line 472 of /etc/httpd/conf/httpd.conf:
ScriptAlias takes two arguments, a fakename and a realname
/usr/sbin/httpd

webfors
12-16-2000, 04:42 PM
Hi Technics,

The first error I'm not sure about. The second one just means that you are defining a script alias incorrectly. Cut and paste that line here and I'll tell you what's wrong with it. Usually it is defined like:

ScriptAlias /cgi-bin/ /home/secure/public_html/cgi-bin/

Now, every server is different but essentially what the ScriptAlias line is saying, is that when people type in http://yourdomain.com/cgi-bin/ -> where is the actual location of this cgi-bin. The second argument in the ScriptAlias line is the absolute path to the actual cgi-bin.

For example if my script alias line was like:

ScriptAlias /cgi/ /home/secure/public_html/cgi-bin/

Then people could type http://domain.com/cgi/ and it would reference my actual cgi bin located at:

/home/secure/public_html/cgi-bin/

-Edward-
12-16-2000, 05:09 PM
*** Heart beat slowing down ***

Phew i fixed it - The server is up and running again. I actually enjoyed that little learning experience. Wouldnt want to go through that again though.

Can someone explain which part of this should i repeat to setup php on another domain?.

marksy
12-17-2000, 08:47 PM
You shouldn't be setting it up on a site by site basis, install it then uncomment these lines in httpd.conf:

#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps

That will make it accessible for all sites (assuming you have compiled it with Apache)