Score:-3

localhost shows index of/ and not the wordpress file for configuration

ht flag

I tried the following: Edit the configuration file:

sudo {editor of choice} 000-default.conf

Note: Be sure to replace {editor of choice} with your editor of choice, be it nano, vim, or anything else that can edit text. Find the DocumentRoot value and edit it accordingly:

DocumentRoot /var/www/html/wordpress

Save the file Restart/Reload the Apache configuration files:

sudo service apache2 restart

And when I did that, I get a blank page and nothing. If I change it back to var/www/html then I at least get the Index Of/ page.

This is a brand new install. My assumption from the guide I am following is that this should show, however the configuration page does not come up when I go to localhost, just the index of/ page:

Now, visit http://localhost from your web browser. You should see the WordPress configuration page. Select your language and click on Continue.

I am following this guide:

https://linuxhint.com/wordpress_dev_debian_10/

in flag
Welcome to AskUbuntu. The copy/paste at the start of the question was clearly written by me on a previous answer, and the LinuxHint guide is all about Debian 10, which is not necessarily the same as Ubuntu. Neither of these actually say anything about your server. Could you [edit] your question to include: (0) the version of Ubuntu you're running (1) the complete location of the files you want Apache to serve (2) any errors that might be reported in `/var/log/apache2/error.log` (or the site-appropriate log file). With this, it may be possible to identify what's missing from your configuration
Alien avatar
jp flag
maybe php is not running ? check that first? because apache is clearly working, check if php is running or not using `systemctl`
cn flag
Is there a reqson not to follow our ubuntu.com (as you are using Ubuntu and not debian?) https://ubuntu.com/tutorials/install-and-configure-wordpress#1-overview
Thomas Simpson avatar
ht flag
I could use that tutorial but then I would need to purge and start over. Also, I don't see php specifically listed under systemctl but I do see that apache2 and mariadb are started. I also see that php is installed when I perform a which php and that returns /usr/bin/php so I'm sure that is good. I also don't see any errors in the error log under /var/log/apache2/error.log. Only thing I see is when I do restart the service.
Score:0
pl flag

You likely haven't enabled the php module in Apache.

sudo a2enmod php7.2 (or whatever version of php you have installed)

Alternatively you can use sudo a2enmod interactively, and it will list out the modules you can enable.

Then reload the apache config

sudo service apache2 reload

Thomas Simpson avatar
ht flag
I did this and ran into an mpm error. I fixed that error and then was able to run the sudo a2enmod php8.5. I then restarted apache2 service without any issues. I am still seeing the same Index Of/ website under localhost. This is really strange
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.