PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 4, 2022

[FIXED] WordPress in var/www/html not loading anything (on digital ocean)

 February 04, 2022     apache, digital-ocean, lamp, wordpress     No comments   

Issue

I'm trying to install my godaddy wordpress site on digital ocean from backup. I installed a digital ocean ubuntu droplet just as instructions described on digital ocean:

  • install apache2, PHP, mysql, and wordpress.
  • I added in my data to the mysql database, and it works because my /phpadmin link was accessible and my tables were present
  • I set config to first look for index.php
  • I copied all the wordpress files /wp-admin /wp-content /wp-includes and other files of that nature into the ~/var/www/html dir
  • I copied the apache index.html file into ~/var/www

When I go to my site.com/ it goes to the /index.html apache file, but nothing else. On my local host I accessed /phpadmin but when I changed name servers example.com/phpadmin didn't work. I tried example.com/html/index.php or variations to no avail.

Here is my example.com.conf file, please let me know anything you think I missed:

exmaple.com.conf

<VirtualHost *:80>
     ServerName example.com
     DocumentRoot /var/www
</VirtualHost>
<VirtualHost *:80>
     ServerName www.example.com
     Redirect permanent / http://example.com/
</VirtualHost>

000-default.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Note: When I did install WP new, it went into ~/root/wordpress if that matters


Solution

The problem was 2 fold:

My files should have been in the var/www dir and not the var/www/html, I don't know why because all tutorials say otherwise.

I didn't have permissions to be given to anyone having a GET request. My friend helped me, I believe this is what he did in command prompt,

first in var/www/html

cat /etc/pa

cat /etc/passwd | grep www

chown -R www-data:www-data ./

then in var/www

mv ./html/*.* ./

ls -aslh html/

rm -rf html/



Answered By - Kevin Danikowski
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing