cover photo

elmussol

elmussol@elsmussols.org

move from apache to nginx

elmussol
 Xerta last edited: Thu, 22 Mar 2018 00:20:20 +0100  
I had a visit from Dan at the weekend and he has persuaded me to move from apache to nginx. One look at the config files persuaded me -- I had a clue what was going on. Scenario is this: red (proper cert) and friendica (self-signed) and owncloud (self-signed) all on the same box.

I'm going to attempt:

aptitude remove apache2 && aptitude install nginx

Any big gotchas foreseen for that kind of plan? (I expect the answer yes which is why I'm asking first.)

#nginx #apache
 tech  nginx  apache
elmussol
  last edited: Thu, 22 Mar 2018 00:19:39 +0100  
It worked.
.htaccess questions

elmussol
 Xerta last edited: Thu, 22 Mar 2018 13:21:37 +0100  
The box I have my Friendica install on is also going to host my Red and OwnCloud. When I set Friendica up originally I git cloned into /var/www. Now I have made /var/www/owncloud and /vaw/www/red and installed OwnCloud and Red into those.

So I know the top level .htaccess file will over-ride the ones in the lower directories and it seems to make sense to tidy the Friendica install into /var/www/friendica.

So the question is do I need a /var/www/.htaccess if I have individualized /var/www/friendica/.htaccess, /var/www/owncloud/.htaccess and /var/www/red/.htaccess files?

I am well aware of the possibility of borking things, so just want to check before I break anything.
 apache  tech
elmussol
  
two https on the same IP using Apache2.2.22

elmussol
 Xerta last edited: Thu, 22 Mar 2018 16:35:18 +0100  
@Red_Matrix_Support_Channel The box which hosts friend.elsmussols.net will shortly have red. and owncloud. joining it. Until I can buy a proper wildcard cert, three self-signeds are going to have to suffice.

Next is the Owncloud which I am testing as I think I can persuade someone to pay me some money for an Owncloud project. I have generated the correct certs and put them in the correct places. I have edited the VHost files, enabled the Owncloud site and get the following:

root@pendle:/etc/apache2/sites-available# apache2ctl configtest 
[Wed Mar 19 22:09:56 2014] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
Syntax OK


This is because i have:

<VirtualHost _default_:443>

In both VHost files. I think I can solve this using /etc/apache2/ports.conf as described in this page: Apache error: _default_ virtualhost overlap on port 443. But I have questions.

How does Apache decide which is first and which has precedence? I'm assuming alphabetical listing of the contents of sites-enabled, but want to make sure.

The page above says:

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.

    NameVirtualHost *:443

    Listen 443
</IfModule>


Does this mean I have to have <VirtualHost:*.443> in both VHost files or do I leave as default the one I want to have priority?
 apache  tech
elmussol
  last edited: Thu, 22 Mar 2018 16:35:54 +0100  
@Arto I'm just playing with cloud stuff to see how it works. I'll wait to put the library and other stuff up on my own space.