Wordpress and Apache

In installed worpdress in a subdirectory under /srv/www/htdocs and it seems to be working but when I perform certain operations I get a 404 error object not found.
The site is under /srv/www/htdocs/test
When I get the error I see in the url bar http://localhost/wp-admin/options-general.php?page=WP-GPX-Maps (the “test” part in the url is missing)
I think Apache is not rewriting well but I cant find out why.
Here’s my .htaccess file:

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

AFAICS you’re already giving the answer yourself: Is mod-rewrite installed and loaded ?
Please show

sudo a2enmod -l

, between CODE tags, the # in the layout ribbon.

Yes, it is

Here’s the output:
actions alias auth_basic authn_file authz_host authz_groupfile authz_core authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl socache_shmcb userdir reqtimeout php5 authn_core version rewrite

So, mod_rewrite is installed and active. There must be something wrong in your WP config.

It’s a basical installation of Wordpress.
I think it’s something related to OpenSuse’s Apache default configuration, but I can’t find out what…

Hello Roberto,

I recently started a blog myself. (Fossadventures.com) I found some handy articles.

You could follow this tutorial for the LAMP install:
https://www.howtoforge.com/tutorial/how-to-install-lamp-stack-on-opensuse_42.1/

And then follow this tutorial for the Worpress part:
https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-opensuse-leap-42-1/

Replace the nano in the tutorial with your own site name.

I installed wordpress in the /srv/www/ directory instead of /srv/www/htdocs/.

(Also I use Nginx instead of Apache).

I hope this might help you to progress in a different way.

Best regards,
Martin

Same beahvior in an XAMPP environment under Windows.
Changing permalink settings in wordpress does not seem to help… :frowning:

Adjust the host to have /srv/www/htdocs/test as the webroot

Where did you obtain the version of WordPress you’re using?

The openSUSE WordPress package is available from the “openSUSE BuildService - PHP:Applications” repository. <http://download.opensuse.org/repositories/server:/php:/applications/openSUSE_Leap_42.3/&gt;

Among other things, the openSUSE README mentions:

Wordpress is installed to /srv/www/wordpress.

An apache mapping is setup to allow it to be accessed at http://your.domain.com/wp

I have other test sites in other folders, like this

/srv/www/htdocs/test2
/srv/www/htdocs/test3
/srv/www/htdocs/test4
and so on

changing the document root doesn’t affect them all?

I got it from wordpress.org

Unfortunately, even if WordPress offers a package for openSUSE, an openSUSE system running WordPress needs the following openSUSE WordPress packages installed from the openSUSE BuildService - PHP:Applications repository, to execute flawlessly without any unexpected failures:


 > LANG=C zypper search --installed-only wordpress
Loading repository data...
Reading installed packages...

S  | Name                         | Summary                             | Type   
---+------------------------------+-------------------------------------+--------
i+ | wordpress                    | World largest Bloging tool          | package
i+ | wordpress-apache             | Configuration file for apache       | package
i+ | wordpress-plugins            | Plugins for wordpress               | package
i+ | wordpress-themes             | Original Themes for wordpress       | package
i+ | wordpress-themes-collections | Some other Themes for wordpress     | package
 > 

One thing to note is, openSUSE, for what ever reason, only offers German language files for WordPress in the PHP Applications repository – I have absolutely no idea why …
[HR][/HR]The “wordpress-apache” package contains only:


 > rpm -ql wordpress-apache
/etc/apache2/conf.d/wordpress.conf
 > 

The “wordpress-plugins” package contains:


 > rpm -ql wordpress-plugins
/srv/www/wordpress/wp-content/plugins/akismet
/srv/www/wordpress/wp-content/plugins/akismet/LICENSE.txt
/srv/www/wordpress/wp-content/plugins/akismet/_inc
/srv/www/wordpress/wp-content/plugins/akismet/_inc/akismet.css
/srv/www/wordpress/wp-content/plugins/akismet/_inc/akismet.js
/srv/www/wordpress/wp-content/plugins/akismet/_inc/form.js
/srv/www/wordpress/wp-content/plugins/akismet/_inc/img
/srv/www/wordpress/wp-content/plugins/akismet/_inc/img/logo-full-2x.png
/srv/www/wordpress/wp-content/plugins/akismet/akismet.php
/srv/www/wordpress/wp-content/plugins/akismet/class.akismet-admin.php
/srv/www/wordpress/wp-content/plugins/akismet/class.akismet-cli.php
/srv/www/wordpress/wp-content/plugins/akismet/class.akismet-rest-api.php
/srv/www/wordpress/wp-content/plugins/akismet/class.akismet-widget.php
/srv/www/wordpress/wp-content/plugins/akismet/class.akismet.php
/srv/www/wordpress/wp-content/plugins/akismet/index.php
/srv/www/wordpress/wp-content/plugins/akismet/readme.txt
/srv/www/wordpress/wp-content/plugins/akismet/views
/srv/www/wordpress/wp-content/plugins/akismet/views/config.php
/srv/www/wordpress/wp-content/plugins/akismet/views/get.php
/srv/www/wordpress/wp-content/plugins/akismet/views/notice.php
/srv/www/wordpress/wp-content/plugins/akismet/views/start.php
/srv/www/wordpress/wp-content/plugins/akismet/views/stats.php
/srv/www/wordpress/wp-content/plugins/akismet/wrapper.php
/srv/www/wordpress/wp-content/plugins/custom-post-widget
/srv/www/wordpress/wp-content/plugins/custom-post-widget/custom-post-widget.php
/srv/www/wordpress/wp-content/plugins/custom-post-widget/images
/srv/www/wordpress/wp-content/plugins/custom-post-widget/images/contentblock-13.png
/srv/www/wordpress/wp-content/plugins/custom-post-widget/images/contentblock-32.png
/srv/www/wordpress/wp-content/plugins/custom-post-widget/images/contentblock.png
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-de_DE.mo
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-de_DE.po
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-fr_FR.mo
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-fr_FR.po
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-nl_NL.mo
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-nl_NL.po
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-pl_PL.mo
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-pl_PL.po
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-ru_RU.mo
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget-ru_RU.po
/srv/www/wordpress/wp-content/plugins/custom-post-widget/languages/custom-post-widget.pot
/srv/www/wordpress/wp-content/plugins/custom-post-widget/popup.php
/srv/www/wordpress/wp-content/plugins/custom-post-widget/post-widget.php
/srv/www/wordpress/wp-content/plugins/custom-post-widget/readme.txt
/srv/www/wordpress/wp-content/plugins/custom-post-widget/screenshot-1.png
/srv/www/wordpress/wp-content/plugins/custom-post-widget/screenshot-2.png
/srv/www/wordpress/wp-content/plugins/hello.php
/srv/www/wordpress/wp-content/plugins/index.php
 > 

The “wordpress-themes” package contains the WordPress “TwentyFifteen”, “TwentySixteen” and “TwentySeventeen” themes, all installed into “/srv/www/wordpress/wp-content/themes/” …

EDIT: it’s working!

I wonder if is there a method to get it work when not in the documentroot…

EDIT2: now my other test sites don’t work anymore…

Please setup the Apache mapping to include the other test sites.