Results 1 to 7 of 7

Thread: Apache configuration issues

  1. #1
    Join Date
    Jan 2014
    Location
    Tbilisi, Georgia
    Posts
    11

    Exclamation Apache configuration issues

    Hello, my system is 13.1 and I have apache 2.4.7-3.4, php 5.5.9-212.3 and mysql

    base dir for web is /srv/www/htdocs/
    it belonged to root, but I manually created user apache in group www and made chown.

    I have several sites installed on local host, for example http://localhost/wordpress/

    homepage is opening, but, no images (subfolders) and error opening any url inside the site, error - not found.
    What is a problem in configuration?

  2. #2

    Default Re: Apache configuration issues

    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...

  3. #3
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,004

    Default Re: Apache configuration issues

    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.
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

  4. #4
    Join Date
    Apr 2013
    Location
    Modra, Slovakia
    Posts
    265

    Default Re: Apache configuration issues

    you either put youir pages back in htdocs or you've to edit /etc/sysconfig/apache2
    13.2 KDE 64bit tumbleweed
    Lenovo G500s, Thinkpad R500

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,143
    Blog Entries
    2

    Default Re: Apache configuration issues

    @Trulala82

    1. 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.

    2. 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,
    Code:
    zypper in yast2-http-server
    3. 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.

    HTH,
    TSU

  6. #6
    Join Date
    Jun 2013
    Location
    Northern Illinois
    Posts
    71

    Default Re: Apache configuration issues

    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.

  7. #7

    Default Re: Apache configuration issues

    Quote Originally Posted by silicon_penguin67 View Post
    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.
    Good speculation.

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •