Question

Wp-admin works but not website

Posted August 20, 2014 16.6k views

A few days ago my website, after months of my website being up, went down. The thing is mysite.com/wp-admin works just fine and I can access the Wordpress Dashboard. Furthermore, I can access and view all other domain’s on this server.

Here is the structure of the folders (in case that matters)

The site that is not working is in /var/www/
The working site is in /var/www/mysite2.com

I am running on Ubuntu 14.04 LAMP

1 comment
  • When you say the site doesn’t work, could you be more specific? Are you getting a 404 error or a WordPress specific error? Are you seeing anything in the Apache error logs when attempting to access the site? tail /var/log/apache2/error.log

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
4 answers

Thanks for the location of the logs!

It is bringing me to a connection time out page (firefox).

The last two errors in the log are:

[Mon Aug 18 17:36:30 2014] [error] [client 222.77.203.77] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 7680 bytes) in /var/www/index.php on line 18

[Wed Aug 20 12:14:04.067120 2014] [core:notice] [pid 6494] AH00051: child pid 8778 exit signal Segmentation fault (11), possible coredump in /etc/apache2

Looks like your are running up against the PHP memory limit. Edit the file /etc/php5/apache2/php.ini and increase the memory limit. Find this part of the file:

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

and increase the number to something higher. Then restart Apache with:

sudo service apache2 restart

Though this also suggests that you should audit your plugins to see what’s using the memory.

Okay, I have increased to

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 512M

Restarted Apache and am still getting the connection timed out error.

Also as for plugins, I have all plugins deactivated for the time being (I am only using advanced custom fields and a 301 redirect plugin so they shouldn’t too resource intensive anyways).

  • Also, what would explain the other directories working but not the www directory (or is the memory limit directory specific)?

  • It’s the memory related to a specific requests. Presumably, there is something consuming a lot of memory on that WordPress site that is related to a plugin or maybe a theme since you’ve already disabled plugins. Most plugins (or themes) are not loaded on the admin panel, which would explain why that works but not the normal site.

  • I will take a look in a couple hours at the files and let you know of my findings. Thank you for the help so far

So apparently all that was needed was replacing the wp-settings.php file. It appears there may have been a script added to that page to make it overload. Thanks for all of your help, now time to step up my server security game so that doesnt happen again.

Thanks!