What is the error exactly? Without it all we can do is speculate wildly
on all of the possible errors that can come up from a web session, and you
can find those in the HTTP RFCs. Post the source of a page calling out
which link is broken, if nothing else.
–
Good luck.
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…
Changing /srv/www/htdocs to wwwrun is an EXTREMELY BAD IDEA. You should never, NEVER do it - root.root should own ALL files there except those that you wish scripts to have the ability to write to (such as an upload directory and even that should be owned by root but have a world write permission)
Your issue is most likely that Wordpress requires the Rewrite module to be enabled and certain Apache configuration directives to be changes (Allowing certain overrides for that directory) - look at /var/log/apache2/error_log
And for the love of god, chown the files back to root.
Good SOP is to install a working solution before you tinker with settings. It’s unclear whether your website ever worked or if you started tinkering before you know your website works.
If you’re new to apache, or specifically apache on openSUSE, instead of modifying your Apache configuration directly, I’d recommend you use the YAST httpd applet… Although there’s some minor things I’ve found that don’t work, those won’t prevent you from configuring Apache correctly. To install,
zypper in yast2-http-server
Although openSUSE does setup root-root permission on the website files, I share your aversion to setting up this way. I haven’t researched whether a Policy might restrict permissions in a different way, changing permissions to its own user account is a common way to restrict permissions, but is more involved than simply doing what you’ve described. Recommend you reverse (chown back to root-root) if you don’t have a complete cookbook for implementing this. But, based purely on your description it sounds to me like your subdirectories may have different file permissions than your web root. Of course, this assumes a very basic website configuration without virtual directories and the like.
Let me speculate wildly!
This sounds like wordpress was installed in /srv/www/htdocs/ so thats the path in the mysql database. Now, it’s in /srv/www/htdocs/wordpress. So going to http://localhost/wordpress will get you the index.php, but the database is looking somewhere else.
OP, if you are going to run multiple websites are you configuring separate vhosts for them or just installing them in subdirs of the default site?
As for root:root permissions, note that apache is initially started as root as it listens on a privileged port. It then forks the the subprocesses run as wwwrun (see pstree or ps aux | grep apache and look at the parent process). For the same reason, you can see permissions on /var/log/apache2/ are also root:root, yet apache can write logs here. Some Linux distributions uses different permissions on these area, but Suse and Red Hat both use root:root.