Page 1 of 7 123 ... LastLast
Results 1 to 10 of 66

Thread: Configuring Apache2 HTTP Server

  1. #1

    Default Configuring Apache2 HTTP Server

    Hi Folks,

    Hoping this is the correct place to post, Most of the stuff here appears to be desktop and no separate forum to discuss server software. I've checked the 15.1 box but this could equally apply to Tumbleweed.

    Configuring Apache2 there are lots of suggested settings pointing at /srv/www/vhosts/ as if it were the default directory to put the web contents into, e.g. /srv/www/vhosts/mydomain.tld/contents. However, there is a htdocs directory, /srv/www/htdocs/ but no /srv/www/vhosts/.

    So it would would be easier, rather than modifying all those paths, to simply mkdir /vhosts and use it. Which leaves htdocs with nothing to do. It is an empty directory. Is there anything pointing towards htdocs which may break if it is deleted?

    TIA,

    Mike

  2. #2

    Default Re: Configuring Apache2 HTTP Server

    Looking through a few of these config files, they appear to be in a time warp. I downloaded Leap 15.1 to the VPS. Are these the correct config files for the current version of Apache2? Which I think is 2.4.? Has anybody else found similar?

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,417
    Blog Entries
    2

    Default Re: Configuring Apache2 HTTP Server

    When installing and configuring any app installed from the oepnSUSE repositories (particularly what you likely would call a "server" app)

    1. If a pattern is available and appropriate, install the pattern, not just the individual components.
    In this particular case, does your website require a LAMP (Linux/Apache/MySQL/PHP) stack?
    If your use case requires these, then install the LAMP pattern instead of each individual component... You';; have a better chance of installing all necessary components and not forgetting something.
    If using YaST Software Manager to install, there is a "Patterns" view, else IIRC you can search for patterns.
    If using zypper, you can list, then install the pattern of your choice.

    2. If a YaST module exists for the app you're installing, install it (if necessary) and use it to configure initially.
    This should get you set up initially with a working, standard configuration which can be tweaked further per your needs.
    If you need help, you're starting from a standard configuration others can replicate or understand already.
    All YaST modules start with "yast2-"
    You can list them using YAST Software Manager or zypper, then install if relevant.
    In the case of Apache, there is the "yast2-http-server" module which can set you up with various onfigurations.

    In the case of Apache,
    There are some additional configurations you may need to do which may not be obvious...
    If you're deploying a PHP website, you'll likely need to activate/enable PHP module support
    If you're running a MySQL/Mariadb instance, you may need to run the standard security script to configure its basic security setup and configure a database Administrator account password.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4

    Default Re: Configuring Apache2 HTTP Server

    Not having experienced yast2, TSU, I am ill placed to comment. The rest of your post I completely concur with. I would also add it makes good sense to test at each possible stage. For instance, add a simple index.html page to the document root and bring it up in the browser as soon as the Apache http server is installed and configured to a stage at which it should be functional; adding a line containing phpinfo(); to a very simple php file, saving it as index.php and opening it in a browser to ensure not only PHP but all of the modules installed with it are configured correctly. None of which will happen if the user forgets to restart apache2 or a2enmod php, which in the case of OpenSUSE would be a2enmod php7 (for 15.1).

    However, using an immediately previously updated zypper to download packages should, surely, install packages which are contemporaneous with the operating system? This is Leap 15.1, not the SuSE-6.1 I installed from a CD inside a book cover which I bought in something like 2002. Could have been 2001 or 2003 but certainly within that time frame.

  5. #5
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,831
    Blog Entries
    14

    Default Re: Configuring Apache2 HTTP Server

    Quote Originally Posted by dominame View Post
    Hi Folks,

    Hoping this is the correct place to post, Most of the stuff here appears to be desktop and no separate forum to discuss server software. I've checked the 15.1 box but this could equally apply to Tumbleweed.

    Configuring Apache2 there are lots of suggested settings pointing at /srv/www/vhosts/ as if it were the default directory to put the web contents into, e.g. /srv/www/vhosts/mydomain.tld/contents. However, there is a htdocs directory, /srv/www/htdocs/ but no /srv/www/vhosts/.

    So it would would be easier, rather than modifying all those paths, to simply mkdir /vhosts and use it. Which leaves htdocs with nothing to do. It is an empty directory. Is there anything pointing towards htdocs which may break if it is deleted?

    TIA,

    Mike
    I've seen instructions re. using /srv/www/vhosts in the past but never used them, stuck to the openSUSE/SUSE default ( stored in /etc/apache2/default-server.conf ) of /srv/www/htdocs and fwiw all 12 domains/subdomains on my VPS run fine, incl. https ( certs managed by letsencrypt ). If you want to override this setting, and install packages that do not read that file but have the webroot configured in the spec file (IMHO they shouldn't but I never had to check) they would install in /srv/www/htdocs anyway. For my own convenience I use the following logic in the naming:
    For subdomain nextcloud.knurpht.com I would create /srv/www/htdocs/nextcloud.knurpht.com . When creating a certificate this results in the cert and keys being created in /etc/letsencrypt/live/nextcloud.knurpht.com . This all results in the ease of being able to use configs from other distros by simply replacing f.e. /var/www/html by /srv/www/htdocs and move on, without having to mess with the defaults. The naming also makes me easily see what folder I have to be in when troubleshooting ( or f.e. looking for config files, logs etc ).

    When getting started, and nothing has been done yet, the easiest way to start is to use YaST's http server module. Enable apache to start at boot, open firewallport ( from the module ), hit OK, go to http://ip_address_of_vps and you should see a page showing "It works !" which is the content of the index.html file in /srv/www/htdocs. If that works you can add vhosts using the same module.

    In short: stick to the openSUSE/SUSE defaults, it will make your life easier. And .... in case of asking for support you can refer to those defaults.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  6. #6
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,707
    Blog Entries
    1

    Default Re: Configuring Apache2 HTTP Server

    Quote Originally Posted by dominame View Post
    Hi Folks,

    Hoping this is the correct place to post, Most of the stuff here appears to be desktop and no separate forum to discuss server software. I've checked the 15.1 box but this could equally apply to Tumbleweed.

    Configuring Apache2 there are lots of suggested settings pointing at /srv/www/vhosts/ as if it were the default directory to put the web contents into, e.g. /srv/www/vhosts/mydomain.tld/contents. However, there is a htdocs directory, /srv/www/htdocs/ but no /srv/www/vhosts/.

    So it would would be easier, rather than modifying all those paths, to simply mkdir /vhosts and use it. Which leaves htdocs with nothing to do. It is an empty directory. Is there anything pointing towards htdocs which may break if it is deleted?

    TIA,

    Mike
    Don't tinker with vendor defaults. Life is easier without doing so. Always use 'yast2 http-server' and 'yast2 sysconfig' unless it definitely gets in your way.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  7. #7

    Default Re: Configuring Apache2 HTTP Server

    @Knurpht on the button with good info about which of the masses of docs OpenSuSE actually state the defaults for this purpose. I'm very grateful. It was certainly not obvious. Also grateful to all three contributors for the nod towards YaST/YaST2, which I'll start to read up on and learn how to use. Yet another {Software or System?} Tool, IIRC.

    Knurpht, do you know if all the OS 15.1 (o-o was it you said in another thread? or o.o?) repos are now up to date? My host still has the corrupted 15.1 with a disaster somewhere in the NetworkManager-Wicked-Firewalld range. I'm finding it extremely difficult to troubleshoot. If I get it wrong the system hangs, won't reboot cleanly and the only cure is to reinstall. I'm not a sysadmin although I've dabbled in IT admin for many years. This is my first time with SuSE of any flavour for, I'd say, about 16 or 17 years. Can I tell the host it's all clear to go ahead and replace it yet?

    TIA. Stay safe and best wishes,

    Mike

  8. #8
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,831
    Blog Entries
    14

    Default Re: Configuring Apache2 HTTP Server

    Quote Originally Posted by dominame View Post
    @Knurpht on the button with good info about which of the masses of docs OpenSuSE actually state the defaults for this purpose. I'm very grateful. It was certainly not obvious. Also grateful to all three contributors for the nod towards YaST/YaST2, which I'll start to read up on and learn how to use. Yet another {Software or System?} Tool, IIRC.

    Knurpht, do you know if all the OS 15.1 (o-o was it you said in another thread? or o.o?) repos are now up to date? My host still has the corrupted 15.1 with a disaster somewhere in the NetworkManager-Wicked-Firewalld range. I'm finding it extremely difficult to troubleshoot. If I get it wrong the system hangs, won't reboot cleanly and the only cure is to reinstall. I'm not a sysadmin although I've dabbled in IT admin for many years. This is my first time with SuSE of any flavour for, I'd say, about 16 or 17 years. Can I tell the host it's all clear to go ahead and replace it yet?

    TIA. Stay safe and best wishes,

    Mike
    No idea what's corrupted. I use wicked with DHCP on my VPS. And used the method I described to setup the domains/subdomains. Can you explain, preferably with error messages between CODE tags what goes wrong?
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  9. #9

    Default Re: Configuring Apache2 HTTP Server

    Quote Originally Posted by Knurpht View Post
    No idea what's corrupted. I use wicked with DHCP on my VPS. And used the method I described to setup the domains/subdomains. Can you explain, preferably with error messages between CODE tags what goes wrong?
    Thanks. Yes, I use this document for guidance https://doc.opensuse.org/documentati...f-using-wicked and systemctl status network tells me NetworkManager is active. NM is not suitable for network handling on a VPS, or so I'm told in other OpenSuSE documentation and am aware it is unsuitable on servers from my own experience, both on Debian and Arch.

    Leap 15.1 was installed from a "Softaculous virtualizor" instance access to which is supplied by the host. he installed it, I later learnt, during the period of the move of OpenSUSE resources from the USA to Germany.

    So when I needed to get IPv6 running on the VS, which it should have been already, I ran the status network command and followed up with the recommended:
    Code:
    :~ # systemctl is-active network && \
    :~ # systemctl stop      network
    :~ # systemctl enable --force wicked
    
    :~ # systemctl start wickedd
    Finally either systemctl start wicked (note no d for daemon added) or systemctl start network, at which point the system hangs and there is nowhere to go. This is now after at least 4 reinstalls and going into the code to try and find any faults. Running wicked with debug on makes no difference at all and the logs are cleared with the reinstall. Hence- impossible. I also tried with yast from the command line but it will not start wicked. At least it does no harm but only leaves the option of going back to forcing. Which breaks.

    I've reached the conclusion that only a clean install is going to fix this. 15.2 is not due for public release until 2 July, almost 4 weeks away.

  10. #10

    Default Re: Configuring Apache2 HTTP Server

    Just found some more information, further down in the document cited above, section 28: following that, once again entering yast from the CLI, the interface got as far as having written configurations for drivers, device, network, routing, hostname and DNS, networks and firewall, it got stuck at 77% of "Activating Network Services". Which is where it remains. I'm leaving it there in the somewhat dubious case it may be able to sort itself out.

Page 1 of 7 123 ... LastLast

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
  •