Link to home
Start Free TrialLog in
Avatar of tonitoni99
tonitoni99

asked on

About Wordpress website

I have a wordpress website on a VM-runs on Debian (Apache, PHP, MySQL).

It has an IP address. I don't know somehow I can access the website by *.*.*.*/html (for example). I would like to access the website directly just typing the IP address in the web browser. So I tried to change the Document Root under

/etc/apache2/site-enabled/000-default

Originally:
DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

To:

DocumentRoot /var/www/html
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>


When I reload the Apache server, when I browse via IP without the /html/, I can only see plain text, but not pictures.

In order to display the wordpress website directly via IP without followed by /html, is it right only to change Document Root? Is there other place I need to change? Thanks
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

When Wordpress processes posts and images, it records the address and paths in the database.  If you change the web root without changing the corresponding entries in the database, then the site won't display correctly.  You must make the database entries match the actual site.
ASKER CERTIFIED SOLUTION
Avatar of Radek Baranowski
Radek Baranowski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am guessing that this is not a new site, but it has content, and it used to have a domain based URL, e.g. www.example.com.

If that is the case, you can place an entry in your PC's hosts file pointing the IP address to that URL, and then go to the URL in your browser.
xxx.xxx.xxx.xxx   www.example.com

Open in new window