efter att du loggat in på servern, kör följande:
locate apachectl
du får då upp adressen till just apachectl (Apache HTTP server control interface)
Vi leker med tanken att den ligger i
/usr/local/apache/bin
skriv då följande:
/usr/local/apache/bin/./apachectl start
Kolla lite på detta (skrev in allt ni ville):
[root@localhost ~]# apachectl
Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t : run syntax check for config files
[root@localhost ~]#
You have new mail in /var/spool/mail/root
[root@localhost ~]# /usr/sbin/httpd/bin/./apachectl start
bash: /usr/sbin/httpd/bin/./apachectl: Inte en katalog
[root@localhost ~]# locate error_log
warning: locate: could not open database: /var/lib/slocate/slocate.db: No such file or directory
warning: You need to run the 'updatedb' command (as root) to create the database.
Please edit /etc/updatedb.conf to enable the daily cron job.
[root@localhost ~]#
ok.. testa köra updatedb som den ber dig om (obs, kan ta ett tag) o se om den hittar error_log sen. Annars leta i /var/log o se om du hittar apache/apache2/httpd lr dyl o leta efter error_log där
sen så skulle du köra
apachectl start .. inte apachectl bara..
Du har även fått mail,
"You have new mail in /var/spool/mail/root"
möjligt att du fått ett error meddelande där..
använd mail
för att läsa
sen kan du låta bli o köra apache som root .... inte det säkraste precis
Hur skulle han annars starta det ? Man måste va root för att starta init scripts..
Apache startas av root.. men övergår sen by default till user apache.
Har du provat service httpd restart ? Om du får "misslyckat" när den ska stoppa så betyder det bara att apache inte är igång. Får du OK när den startar så är det bra. Får du inte OK när den ska starta är det antagligen något fel i filen /etc/httpd/conf/httpd.conf