dittbub Posted February 17, 2004 Share Posted February 17, 2004 Alright so i got some linux labs here and i'm a bit stuck on httpd schtuff. One of the things i am to do is to make httpd run at start up. i did it, but i think i did it the wrong way. i searched it and the simplest way i found was to add the line "httpd -k start" to /etc/rc.d/rc.local. Is this ok or is there a more 'right' way to get this to run at startup? there are a few questions i'm suppose to answer here... i don't want the answers i just want to know what do i do in order to find the answers. a) which file does httpd send out by default to requests? Can this be changed, how? b) which port does httpd acknowledge incoming requests on? c) which files are responsible for the behavior of the httpd? d) what logs does the httpd update? e) who wrote this version of http? Link to comment Share on other sites More sharing options...
markwolfe Veteran Posted February 17, 2004 Veteran Share Posted February 17, 2004 I don't run httpd, but I think it is in xinetd, isn't it? You can check on (or start/stop) services using chkconfig -l (the -l to list). Sounds like you are taking an online class? If so, let me know which one, because I still have some learning to do, myself. :) Mark Link to comment Share on other sites More sharing options...
amr_01 Posted February 17, 2004 Share Posted February 17, 2004 to start apache automatically, you want to put /path/to/httpd/bin/apachectl start in the /etc/rc.d/rc.local it will look something like this in the rc.local file: /etc/httpd/bin/apachectl start, save the file, and it should start on boot. all answers can be found here. Apache 2.0.x Apache 1.3.x Link to comment Share on other sites More sharing options...
dittbub Posted February 17, 2004 Author Share Posted February 17, 2004 I don't run httpd, but I think it is in xinetd, isn't it? You can check on (or start/stop) services using chkconfig -l (the -l to list).Sounds like you are taking an online class? If so, let me know which one, because I still have some learning to do, myself. :) Mark chkconfig -l didn't work... I'm sorry, but i'm not taking an online course. I'm taking a linux course at the college i'm enrolled at. it will look something like this in the rc.local file: /etc/httpd/bin/apachectl start, save the file, and it should start on boot.aight that worked too.all answers can be found here.Apache 2.0.x Apache 1.3.x hmm, are there ways to get the answers from my box, not from teh int0rweb? Link to comment Share on other sites More sharing options...
amr_01 Posted February 17, 2004 Share Posted February 17, 2004 httpd.conf is the file that has all the settings for your apache, it tells what port, what address, and i believe where it logs. check it out. it should be in the httpd folder somewhere, i don't remember exactally where though., Link to comment Share on other sites More sharing options...
dotRoot Posted February 17, 2004 Share Posted February 17, 2004 Might as well look in the httpsd too and do the same questions for extra credit. Link to comment Share on other sites More sharing options...
kemical Posted February 17, 2004 Share Posted February 17, 2004 updatedb locate httpd.conf and if apache was installed correctly the manaul for your version of apache should have been included, it would be located in your DocumentRoot directory ;P which you can also set in httpd.conf Link to comment Share on other sites More sharing options...
dittbub Posted February 18, 2004 Author Share Posted February 18, 2004 hey cool thanks alot guys. now. cgi scripting. give me a good link on basic cgi stuff i'm gunan google now but if you already know of a good site, please let me know! Link to comment Share on other sites More sharing options...
kemical Posted February 18, 2004 Share Posted February 18, 2004 cgi.resourceindex.com Link to comment Share on other sites More sharing options...
UKer Posted February 19, 2004 Share Posted February 19, 2004 (edited) Configuring services is different from distro to distro, for example RedHat/SUSE allow you to choose them with a GUI. The files that start/stop services normally reside in /etc/init.d - and to add a service one of these files needs to be created. These can be used to start/stop services manually as well as being run at startup (if they're executable), for example in SUSE you can do (as root) '/etc/init.d/apache2 [start/stop/restart]'. Gentoo includes a script for adding services called rc-update, but I have very little experience with this personally as only RH/SUSE are allowed on out uni network :( and I have always created these scripts myself (a very handy skill as one of the most common tests companies have to examine UNIX proficency is to correctly create init scripts with all appropriate functions (e.g. start/stop/restart)). On SUSE at least the different scripts run for each runlevel are in directories themselves within /etc/init.d called rcX.d (where X is the runlevel, for example runlevel 3 is rc3.d and 5 rc5.d). In these directories are links to the scripts in /etc/init.d using the standard LSB naming conventions. A handy guide for init scripts is here (Gentoo but applies to almost any distro) and the LSB Spec for these files is here. Note that these scripts are not trivial and can be long (the SUSE apache2 script is 8 pages of code!). Note this info is only relevant really if a script doesn't already exist for the service (check /etc/init.d/) if it already is there then, as markjensen stated you can use chkconfig to enable/disable services at different runlevels, but I'de recommend to anyone wanting to learn any UNIX to learn how to write their own init scripts as it's an essential skill. Edited February 19, 2004 by UKer Link to comment Share on other sites More sharing options...
dittbub Posted February 21, 2004 Author Share Posted February 21, 2004 aight, thanks. heh, what can i use as an ftp server? can apache do it? does linux come with a good ftp server prog? Link to comment Share on other sites More sharing options...
bladerunner81 Posted February 21, 2004 Share Posted February 21, 2004 you could try proftpd, it's a good one. apache is a http-server and can't do ftp-serving. Link to comment Share on other sites More sharing options...
markwolfe Veteran Posted February 21, 2004 Veteran Share Posted February 21, 2004 aight, thanks.heh, what can i use as an ftp server? can apache do it? does linux come with a good ftp server prog? Every mainstream Linux distro comes with all the various server types you will need. HTTP, FTP, DHCP, Samba, etc. If you have your original installation CDs, just install it from there and give it a try. (Also, please learn from Mainsoft's mistake, and keep your system up to date on your patches) :yes: Apache is an HTTP server only (as far as I know, anyhow). Link to comment Share on other sites More sharing options...
the evn show Posted February 21, 2004 Share Posted February 21, 2004 Apache can serve up FTP connections if you install the appropriate module. In this case mod_ftp. There are other modules for things like WebDAV and POP3 too. The benefits of using Apache to handle FTP is that you can make use of apache's authentication and other modules with the FTP server making it more powerful. The downside is that adding capabilities to Apache also increases the potential for a bug to let hell break loose. Link to comment Share on other sites More sharing options...
Recommended Posts