What Would Cause Apache To Restart And Not Compile PHP
Apr 22, 2007
Today I got the devastating and heart-stopping news that all administraters fear most: "I'm looking at your website, and something's terribly wrong!!!"
The person went on to say that each page was just "filled with code ro something." When I finally saw it myself I discovered that my raw PHP pages were being served to the end user with no compilation --all of my top secret code; a real nightmare.
I went to look at the error logs and found that for several restarts Apache had not been compiling PHP.
[Sun Apr 22 04:02:18 2007] [notice] Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_gzip/1.3.19.1a configured -- resuming normal operations
[Sun Apr 22 04:02:18 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Apr 22 04:02:18 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/a1b2c3d4e5f6g7h8i9/nonexistentfile.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/adxmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/adserver/adxmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/phpAdsNew/adxmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/phpadsnew/adxmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/phpads/adxmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/Ads/adxmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/ads/adxmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/xmlrpc/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/xmlsrv/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/blog/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/drupal/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/community/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/blogs/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/blogs/xmlsrv/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/blog/xmlsrv/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/blogtest/xmlsrv/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/b2/xmlsrv/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/b2evo/xmlsrv/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/wordpress/xmlrpc.php
[Sun Apr 22 21:21:57 2007] [error] [client 209.85.60.98] File does not exist: /var/www/html/phpgroupware/xmlrpc.php
[Mon Apr 23 04:02:21 2007] [notice] SIGUSR1 received. Doing graceful restart
WTH?
I could be WAAAY off base, but my first reaction was that I'd been hacked -- someone had found a way to disable PHP so they could find sensitive information in raw PHP pages. That could be totally wrong.
At any rate, even if I never learn why Apache sometimes will compile without PHP (and some other modules) without me telling it to do so, I'd like to be prepared for an embarassment like like this.
Is there any way, say, in the .htaccess file (or anywhere, anyway), I can tell Apache not to serve **ANY** pages unless the PHP module is present?
We run CentOS for our web servers (not providing hosting) and manually compile Apache, PHP etc. What would be the benefits to using Yum rather than compiling the software ourselves?
The way I see it, Yum allows Apache etc to automatically update to latest versions and saves time. When compiling myself though, I can specify exactly where to install to and which modules etc to install with the software. Is there any reason we should be using Yum instead?
I'm setting up a Linux machine specifically for use as a VNC here at work.
The IT Manager said he'd used Ubuntu before but left the distro up to me.
I set up my test machine with Ubuntu but need to compile Apache for portions of it to work. I've never had any problems building Apache before, but this is what I'm getting here. I have a feeling that, since I've not used Ubuntu before, that I'm just missing a step. I also noticed that the "make" command doesn't work. Does that need to be installed and compiled as well?
========================================= root@vnc01:/etc/httpd-2.2.3# ./configure /usr/local/apache configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: /usr/local/apache checking for chosen layout... Apache checking for working mkdir -p... yes checking build system type... /usr/local/apache checking host system type... /usr/local/apache checking target system type... /usr/local/apache
Configuring Apache Portable Runtime library ...
checking for APR... reconfig configuring package in srclib/apr now configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: /usr/local/apache checking build system type... /usr/local/apache checking host system type... /usr/local/apache checking target system type... /usr/local/apache Configuring APR library Platform: /usr/local/apache checking for working mkdir -p... yes APR Version: 1.2.7 checking for chosen layout... apr checking for /usr/local/apache-gcc... no checking for gcc... no checking for /usr/local/apache-cc... no checking for cc... no checking for cc... no checking for /usr/local/apache-cl... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. configure failed for srclib/apr root@vnc01:/etc/httpd-2.2.3#
The config.log file doesn't honestly show any errors that I can see pertaining to any compile errors.
Recently purchased a new dedicated machine from a Savvis wholesaler, with intentions of using it as a backup server, CentOS 5.0 default install with default install of cPanel/WHM (not configured by the DC) -- Went to recompile apache with the appropriate addons and modules and this is why I get, any ideas?
Linux local.hostname 2.6.18-8.el5 #1 SMP Thu Mar 15 19:57:35 EDT 2007 i686 athlon i386 GNU/Linux
Quote:
Building Apache Config.....Done Downloading and compiling apache+modules....
Fetching http://layer1.cpanel.net/buildapache.sea (0)....@75.126.236.226......connected......receiving...1%...2%...3%...4%...5%...6%...7%...8%...9%...10%...11%...12%...13%...14%...15%...16%...17%...18 %...19%...20%...21%...22%...23%...24%...25%...26%...27%...28%...29%...30%...31%...32%...33%...34%...35%...36%...37%...38%...39%...40%...41%...42%...43 %...44%...45%...46%...47%...48%...49%...50%...51%...52%...53%...54%...55%...56%...57%...58%...59%...60%...61%...62%...63%...64%...65%...66%...67%...68 %...69%...70%...71%...72%...73%...74%...75%...76%...77%...78%...79%...80%...81%...82%...83%...84%...85%...86%...87%...88%...89%...90%...91%...92%...93 %...94%...95%...96%...97%...98%...99%...100%......Done Verifying archive integrity... All good. Uncompressing buildapache........................................................................................................................................... ...................................................................................................................................................... ...................................................................................................................................................... ........................................................................................................................................... Checking Update System........Rpm Sanity Check PASSED! Verifying compiler and libs....Verifying installation....Kernel Headers look good! Using newyum support... Loading "installonlyn" plugin Setting up Install Process Setting up repositories Reading repository metadata in from local files Excluding Packages in global exclude list Finished Parsing package install arguments Nothing to do
Done Done ******************************** This is buildapache version 1.5.402 (for cpanel <= 10.9.3) (ap=1.3.37) ******************************** buildapache configured from Web Host Manager Apache configured from Web Host Manager! Untarring expat...Fetching http://httpupdate.cpanel.net/buildap...-1.95.6.tar.gz (0)....@75.126.236.226......connected......receiving...1%...2%...4%...5%...7%...8%...9%...11%...12%...14%...15%...16%...18%...19%...21%...22%...23%... 25%...26%...28%...29%...30%...32%...33%...35%...36%...37%...39%...40%...42%...43%...44%...46%...47%...49%...50%...51%...53%...54%...56%...57%...58%... 60%...61%...63%...64%...65%...67%...68%...70%...71%...72%...74%...75%...77%...78%...79%...81%...82%...84%...85%...87%...88%...89%...91%...92%...94%... 95%...96%...98%...99%...100%......Done Done
make[1]: *** [install-data] Error 127 make: *** [install-all] Error 2 /etc/rc.d/init.d/httpd start: httpd could not be started Setting /home permissions to 0711......Done Setting permissions for........Done This script will install Postgres 7.3.x or later If you have an older version installed you wil need to Dump your databases to a file and then restore them after the install as 7.3.x is not backwards compatible. If you do not have any databases, you can just run: mv /var/lib/pgsql /var/lib/pgsql.old /sbin/service postgresql stop /sbin/service postgresql start to force creating a 7.3.x style setup. Do not do this if you have databases that you wish to keep!
Are you sure you wish to proceed? Loading "installonlyn" plugin Setting up Install Process Setting up repositories Reading repository metadata in from local files Excluding Packages in global exclude list Finished Parsing package install arguments Nothing to do Stopping postgresql service: [ OK ] Starting postgresql service: [ OK ] You should now configure postgresql from WHM! You should now configure postgresql from WHM! You should now configure postgresql from WHM! You should now configure postgresql from WHM! Fetching http://httpupdate.cpanel.net/buildap...-2.6.22.tar.gz (0)....@75.126.236.226......connected......receiving...1%...2%...3%...4%...5%...6%...7%...8%...9%...10%...11%...12%...13%...14%...15%...16%...17%...18 %...19%...20%...21%...22%...23%...24%...25%...26%...27%...28%...29%...30%...31%...32%...33%...34%...35%...36%...37%...38%...39%...40%...41%...42%...43 %...44%...45%...46%...47%...48%...49%...50%...51%...52%...53%...54%...55%...56%...57%...58%...59%...60%...61%...62%...63%...64%...65%...66%...67%...68 %...69%...70%...71%...72%...73%...74%...75%...76%...77%...78%...79%...80%...81%...82%...83%...84%...85%...86%...87%...88%...89%...90%...91%...92%...93 %...94%...95%...96%...97%...98%...99%...100%......Done
I am trying to install dedicated web server on my Slackware 12.0.0 machine. I am a novice in Linux, but succeeded in MySQL & proFTPd installation. The problem now in httpd compiling.
I downloaded the latest Apache 2.2.9, but it needs Apache Portable Runtime 1.3.2 installed. I downloaded 1.3.2 version and run ./configure
1. checking size of size_t... 4 2. checking which format to use for apr_size_t... %u 3. checking size of off_t... 4 4. checking for mmap64... yes 5. checking for sendfile64... yes 6. checking for sendfilev64... no 7. checking for mkstemp64... yes 8. checking for readdir64_r... yes 9. checking which type to use for apr_off_t... off64_t 10. checking whether ino_t and unsigned long are the same... yes 11. configure: using unsigned long for ino_t 12. checking size of pid_t... 4 13. checking whether byte ordering is bigendian... no 14. checking size of struct iovec... 8 15. checking for strnicmp... no 16. checking for strncasecmp... yes 17. checking for stricmp... no 18. checking for strcasecmp... yes 19. checking for strdup... yes 20. checking for strstr... yes 21. checking for memchr... yes 22. checking for strtoll... yes 23. 24. Checking for DSO... 25. checking for dlopen... no 26. checking for dlopen in -ldl... yes 27. adding "-ldl" to LIBS 28. checking for dlsym... yes 29. 30. Checking for Processes... 31. checking for waitpid... yes 32. checking for Variable Length Arrays... yes 33. checking struct rlimit... yes 34. 35. Checking for Locking... 36. checking for semget... yes 37. checking for semctl... yes 38. checking for flock... yes 39. checking for semaphore.h... (cached) yes 40. checking OS.h usability... no 41. checking OS.h presence... no 42. checking for OS.h... no 43. checking for library containing sem_open... none required 44. checking for sem_close... yes 45. checking for sem_unlink... yes 46. checking for sem_post... yes 47. checking for sem_wait... yes 48. checking for create_sem... no 49. checking for working sem_open... yes 50. checking for union semun in sys/sem.h... no 51. checking for LOCK_EX in sys/file.h... yes 52. checking for F_SETLK in fcntl.h... yes 53. checking for SEM_UNDO in sys/sem.h... yes 54. checking for POLLIN in poll.h sys/poll.h... yes 55. checking for PTHREAD_PROCESS_SHARED in pthread.h... yes 56. checking for pthread_mutexattr_setpshared... yes 57. checking for working PROCESS_SHARED locks... yes 58. checking for robust cross-process mutex support... yes 59. decision on apr_lock implementation method... SysV IPC semget() 60. checking if all interprocess locks affect threads... no 61. checking if POSIX sems affect threads in the same process... no 62. checking if SysV sems affect threads in the same process... no 63. checking if fcntl locks affect threads in the same process... no 64. checking if flock locks affect threads in the same process... no 65. checking for entropy source... /dev/urandom 66. 67. Checking for File Info Support... 68. checking for struct stat.st_blocks... yes 69. checking for struct stat.st_atimensec... no 70. checking for struct stat.st_ctimensec... no 71. checking for struct stat.st_mtimensec... no 72. checking for struct stat.st_atim.tv_nsec... yes 73. checking for struct stat.st_ctim.tv_nsec... yes 74. checking for struct stat.st_mtim.tv_nsec... yes 75. checking for struct stat.st_atime_n... no 76. checking for struct stat.st_ctime_n... no 77. checking for struct stat.st_mtime_n... no 78. checking for inode member of struct dirent... d_fileno 79. checking for file type member of struct dirent... d_type 80. 81. Checking for OS UUID Support... 82. checking uuid.h usability... no 83. checking uuid.h presence... no 84. checking for uuid.h... no 85. checking uuid/uuid.h usability... yes 86. checking uuid/uuid.h presence... yes 87. checking for uuid/uuid.h... yes 88. checking for library containing uuid_create... no 89. checking for library containing uuid_generate... -luuid 90. checking for uuid_create... no 91. checking for uuid_generate... yes 92. checking for os uuid usability... yes 93. 94. Checking for Time Support... 95. checking for struct tm.tm_gmtoff... yes 96. checking for struct tm.__tm_gmtoff... no 97. 98. Checking for Networking support... 99. checking for type in_addr... yes 100. checking if fd == socket on this platform... yes 101. checking style of gethostbyname_r routine... glibc2 102. checking 3rd argument to the gethostbyname_r routines... char 103. checking style of getservbyname_r routine... glibc2 104. checking if TCP_NODELAY setting is inherited from listening sockets... yes 105. checking if O_NONBLOCK setting is inherited from listening sockets... no 106. checking whether TCP_NODELAY and TCP_CORK can both be enabled... yes 107. checking for TCP_CORK in netinet/tcp.h... yes 108. checking for TCP_NOPUSH in netinet/tcp.h... no 109. checking for SO_ACCEPTFILTER in sys/socket.h... no 110. checking whether SCTP is supported... no 111. checking for struct ip_mreq... yes 112. checking for set_h_errno... no 113. 114. Checking for IPv6 Networking support... 115. checking for library containing getaddrinfo... none required 116. checking for library containing gai_strerror... none required 117. checking for library containing getnameinfo... none required 118. checking for gai_strerror... yes 119. checking for working getaddrinfo... yes 120. checking for negative error codes for getaddrinfo... yes 121. checking for working getnameinfo... yes 122. checking for sockaddr_in6... yes 123. checking for sockaddr_storage... yes 124. checking for working AI_ADDRCONFIG... yes 125. checking if APR supports IPv6... yes 126. checking langinfo.h usability... yes 127. checking langinfo.h presence... yes 128. checking for langinfo.h... yes 129. checking for nl_langinfo... yes 130. 131. Restore user-defined environment settings... 132. restoring CPPFLAGS to "" 133. setting EXTRA_CPPFLAGS to "-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE" 134. restoring CFLAGS to "" 135. setting EXTRA_CFLAGS to "-g -O2 -pthread" 136. restoring LDFLAGS to "" 137. setting EXTRA_LDFLAGS to "" 138. restoring LIBS to "" 139. setting EXTRA_LIBS to "-luuid -lrt -lcrypt -lpthread -ldl" 140. restoring INCLUDES to "" 141. setting EXTRA_INCLUDES to "" 142. configure: creating ./config.status 143. config.status: creating Makefile 144. config.status: creating include/apr.h 145. config.status: creating build/apr_rules.mk 146. config.status: creating build/pkg/pkginfo 147. config.status: creating apr--config 148. config.status: WARNING: 'apr-config.in' seems to ignore the --datarootdir setting 149. config.status: creating apr.pc 150. config.status: creating test/Makefile 151. config.status: creating test/internal/Makefile 152. config.status: creating include/arch/unix/apr_private.h 153. config.status: executing default commands 154. config.status: include/apr.h is unchanged 155. config.status: include/arch/unix/apr_private.h is unchanged
After that I am trying make and have error at the end:
I have 8 apache servers that is sharing one httpd.conf file... When changes made in the httpd.conf, you have you restart httpd... How can I restart all 8 servers at the same time instead of logging into each server and do it manually?
We are unable to restart apache on our server, as a result no sites are accessible in the browser. Our host states we need to clear out the following files:
I have no trouble logging in through SSH Also no problem accessing webmin on port 10000
I've tried to restart Apache httpd And tried to reboot the server...
Nothing.
I recently did a Yum Update, also removed ISPconfig - it's probably the latter thats the problem, although I haven't used it - at all - just playing around setting up PHPmyadmin, Squirrelmail and a couple of email accounts.
But the only error log output I get is that there are no virtual servers for 88.198.81.186:80 and 88.198.81.187:80 and Unable to open logs | unable to start piped log program
Since the update and removal of ISPconfig 4-5 days ago there hasn't been any issues. I haven't done anything. Yet I do think might be some of the old ISPconfig settings acting up.
I am running CPanel and WHM, and every morning, I need to restart apache manually in order to work. Then it works for the whole day. It crashes I guess, but I don't know why. What logs do I need to check?
Code: [Sat Jul 28 21:40:09 2007] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations [Sat Jul 28 21:45:08 2007] [notice] caught SIGTERM, shutting down [Sat Jul 28 21:45:18 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Sat Jul 28 21:45:18 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:18 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:18 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:18 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:18 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:18 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:18 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [notice] Digest: generating secret for digest authentication ... [Sat Jul 28 21:45:19 2007] [notice] Digest: done [Sat Jul 28 21:45:19 2007] [notice] LDAP: Built with OpenLDAP LDAP SDK [Sat Jul 28 21:45:19 2007] [notice] LDAP: SSL support unavailable [Sat Jul 28 21:45:19 2007] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads. [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:45:19 2007] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations [Sat Jul 28 21:50:08 2007] [notice] caught SIGTERM, shutting down [Sat Jul 28 21:50:08 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Sat Jul 28 21:50:08 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? [Sat Jul 28 21:50:08 2007] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!? ........
Server runs FreeBSD 6.1 and WHM/CPanel. Everything was working as usual, no changes were being made to the server, and all of a sudden all the web sites went down. WHM and CPanel and SSH remained accessible.
Restarting Apache (HTTPD) through WHM gives an error: "httpd has failed, please contact the sysadmin."
Rebooting the server didn't help, httpd still won't restart.
Attempting to do it via SSH gives this error:
server# /etc/rc.d/init.d/httpd restart /etc/rc.d/init.d/httpd restart: httpd not running, trying to start Syntax error on line 210 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: /usr/local/lib/mysql/libmysqlclient.so.14: Undefined symbol "gethostbyname_r" /etc/rc.d/init.d/httpd restart: httpd could not be started
# tail -f /usr/local/apache/logs/error_log only shows some standard http errors for files not being found.
I am having an issue with apache. Want to know how people are running huge forums having 700 800 users online at a time.
I am currently running a single forum having peak users upto 250, making posts and downloading files from within forum. Its running on dual opteron with 2 gig ram and its database is hosted on another cross connected dual opteron + 2 gig ram server.
Although there are enough resources, no load is there but still apache just crahsed and restarts after 4 min interval. As it seems apache gets out of resources and crashes.
how to allow apache to use more ram and cpu so that it simply don't crash.
I keep trying to restart Apache but it wont restart... I run a command line to restart it, but nothing happens. Here is what I have tried:
Quote:
-bash-3.1# chroot /home/fatehost.net/runtime_layeredpanel/ fatehost:/# /etc/ bash: /etc/: is a directory fatehost:/# /etc/init.d bash: /etc/init.d: is a directory fatehost:/# /etc/init.d/httpd-users Usage: /etc/init.d/apache2 start|stop|restart|reload|force-reload fatehost:/# /etc/init.d/httpd-users start Starting web server: Apache2(98)Address already in use: make_sock: could not bind to address 205.209.135.132:80 no listening sockets available, shutting down Unable to open logs fatehost:/# /etc/init.d/httpd-users restart Forcing reload of web server: Apache2httpd (pid 5955) already running . fatehost:/# /etc/init.d/httpd-users force-reload Forcing reload of web server: Apache2. fatehost:/# /etc/init.d/httpd force-reload Forcing reload of web server: Apache2. fatehost:/# /etc/init.d/httpd-users restart Forcing reload of web server: Apache2httpd (pid 13475) already running . fatehost:/# fatehost:/# /etc/init.d/httpd-users start Starting web server: Apache2(98)Address already in use: make_sock: could not bind to address 205.209.135.132:80 no listening sockets available, shutting down Unable to open logs fatehost:/# /etc/init.d/httpd-users stop Stopping web server: Apache2. fatehost:/# fatehost:/# /etc/init.d/httpd-users start Starting web server: Apache2(98)Address already in use: make_sock: could not bind to address 205.209.135.132:80 no listening sockets available, shutting down Unable to open logs fatehost:/# fatehost:/# sudo /etc/init.d/httpd-users stop bash: sudo: command not found fatehost:/# su root /etc/init.d/httpd-users restart Forcing reload of web server: Apache2httpd (pid 20391) already running . fatehost:/# /etc/init.d/httpd-users reboot Usage: /etc/init.d/apache2 start|stop|restart|reload|force-reload fatehost:/# reboot WARNING: could not determine runlevel - doing soft reboot (it's better to use shutdown instead of reboot from the command line) shutdown: timeout opening/writing control channel /dev/initctl init: timeout opening/writing control channel /dev/initctl fatehost:/# WARNING: could not determine runlevel - doing soft reboot bash: WARNING:: command not found fatehost:/# (it's better to use shutdown instead of reboot from the command line) > shutdown: timeout opening/writing control channel /dev/initctl > init: timeout opening/writing control channel /dev/initctl > fatehost:/# /home/fatehost.net/runtime_layeredpanel bash: /home/fatehost.net/runtime_layeredpanel: No such file or directory fatehost:/#
ive got a fairly beefy server but at the moment its hosting alot of resource intensive sites (unfortunatly i dont currently have a choice on where to run them all) and apache is crashing to the point its taking upto 2 mins to load pages within about 24hours but once restarted is fine again. so im wondering if anyone can suggest a way to automaticly restart apache via a cron job every 24hours or so?
I am having a problem on my VPS. I am running the latest version of Apache on Windows Server 2K3, and after editing httpd.conf to allow virtual hosts (#Include /conf/extra/httpd-vhosts.conf) and trying to restart the service, an error appears saying the operation failed.
I have even tried restarting/starting the service via services.msc
If I am not using the default httpd.conf Apache will not restart at all... it is very strange. I have also tried doing a repair of the installation of Apache.
Sometimes my apache gets hanged due to memory leak or persistence connection, then needs to be restarted manually, how can I make this process automatic, that is it get restarted whenever it got hanged or shutdown?
My host is experiencing "issues" with my WordPress. It keeps going above their upper limit of open MySQL connections. So, while I am diagnosing it, I need to restart the server every few hours to avoid it going down.
How do I write a cron to restart Apache every 3 hours?
I have root ssh access to a server and we notice when doing a bash ./mysq-backup script to dump the data from the web site's databases into .sql and .tgz them that httpd goes down sometimes. That, and sometimes it seems that httpd goes down in other situations. All fine, we will figure out why. But ..
It would be nice to run a crontab to check every 15 minutes if httpd is running, if not, to restart it.
Right now I when I notice the site is down I log into the ssh as root and type: service httpd restart. If it is up it will then first stop it, and restart it. I can look at the screen and see it happen, so I feel pretty safe doing this. One of my concerns is that when I am not at the screen and it stays down .. I do not notice this and downtime increases. And we don't want to just crontab service httpd restart, so a bash script to check for the pid and restart if it down .. would be nice.
I thought this would work: (chmod 755 httpdcheck)
Code: delta:~ root# cat httpdcheck #!/bin/bash
if [ ! "$(pidof httpd)" ] then echo "Could not find pid of httpd - restarting" service httpd restart else echo "Found pid of httpd - NO need to restart" fi delta:~ root# And I have this crontab entry:
Code: delta:~ root# crontab -l */5 * * * * /root/httpdcheck | mail my@email delta:~ root# When testing, I did service httpd stop and waited 5 minutes and I received the email : could not find it, restarting. But when I go to the web site in browser it remains down. I have to login to ssh and do service httpd start manually to really load it.
Manually loading btw .. shows it works as bash script just fine, so I dont't know why it won't work when run from cron?
Code: delta:~ root# ./httpdcheck Could not find pid of httpd - restarting Stopping httpd: [FAILED] Starting httpd: [ OK ] delta:~ root#
So .. when is it going wrong? Am I forgetting something?