It is currently Wed Jan 20, 2021 11:18 pm
All times are UTC + 8 hours

[HOWTO] Keep custom Virtual Hosts configs

Web hosting, MySQL, PHP and all that good stuff.

[HOWTO] Keep custom Virtual Hosts configs

Postby blackstar » Fri Apr 26, 2013 8:03 pm

Hi,
I tried setting two vhost following this tutorial (http://lightyearsoftware.com/2012/01/gi ... s-control/) : one for port 80 and one on port 443
I left aside the htpasswd part as the command doesn't seem to exist on the asustor (something that would be nice to have).
It worked fine but as soon as I exit the vi editor for my vhosts they revert to the state in which the asustor system created them...

How do I make it so that the system keeps my custom configuration instead of overriding them as sson as I leave the editor ?

Thanks.
blackstar
 
Posts: 59
Joined: Thu Apr 25, 2013 3:37 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby James.W@AST » Thu May 02, 2013 11:33 am

Hi there,

I am sorry, but the system doesn't support using CLI to edit the vhost config directly. You need to use the ADM web interface (Services > Web Server > Virtual Host) to edit it.

JW
To Infinity and Beyond!

Friends of My AS-606T: (RAID 5 with WD Black 2TB * 4, WD Red 2TB * 2)
MacBook Air (10.8) & Self-assembled Windows PC (Windows 7)
iPhone 4S (iOS 6) & iPad 2 (iOS 6)
Boxee Box, Logitech Squeezebox Duet
SONY HT-CT150 Sound Bar (Connected directly to the NAS via HDMI)
CISCO Linksys E4200
User avatar
James.W@AST
 
Posts: 189
Joined: Wed Jun 06, 2012 12:50 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby blackstar » Sat May 11, 2013 1:28 am

Hi,
I'm fine with using the ADM interface however I couldn't find anyplace to edit the virtual host in the manner I wanted.

BTW, what about the htpasswd command, any way to get it working on the nas system ?

Thanks.
blackstar
 
Posts: 59
Joined: Thu Apr 25, 2013 3:37 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby James.W@AST » Mon May 13, 2013 2:46 pm

Hi there,

1. What kind of options you would like to configure for Virtual Host? We can provide it in the ADM interface.

2. Thanks for the suggestion. We will add htpasswd in the future firmware. If you would like to use it in advance, you can download the attachment, unzip and place it in /usr/builtin/bin/.
Attachments
htpasswd.zip
(6.15 KiB) Downloaded 375 times
To Infinity and Beyond!

Friends of My AS-606T: (RAID 5 with WD Black 2TB * 4, WD Red 2TB * 2)
MacBook Air (10.8) & Self-assembled Windows PC (Windows 7)
iPhone 4S (iOS 6) & iPad 2 (iOS 6)
Boxee Box, Logitech Squeezebox Duet
SONY HT-CT150 Sound Bar (Connected directly to the NAS via HDMI)
CISCO Linksys E4200
User avatar
James.W@AST
 
Posts: 189
Joined: Wed Jun 06, 2012 12:50 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby blackstar » Mon May 13, 2013 4:22 pm

Hi,
Thanks for the quick reply. Basically, I'm trying to set an https access to my git repo, at least until the ssh users options comes out :)
So I was foolowing a tutorial ( see link in previous post) to set up the virtual hosts and configure git to serve the repos through https as well:

# mod_authn_alias essentially configures groups of users.
<AuthnProviderAlias file internal>
AuthUserFile /etc/apache2/git-internal.htpasswd
</AuthnProviderAlias>

<AuthnProviderAlias file clients>
AuthUserFile /etc/apache2/git-clients.htpasswd
</AuthnProviderAlias>

<VirtualHost YOUR-SERVER-IP:443>
SSLEngine on
SSLCertificateFile PATH-TO-YOUR-CERTIFICATE-FILE

ServerName YOUR-SERVER-NAME
ErrorLog /var/log/apache2/git-error.log
CustomLog /var/log/apache2/git-access.log combined

DocumentRoot /home/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GIT_PROJECT_ROOT /home/git

# Let Apache serve static files
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /home/git/$1
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /home/git/$1

ScriptAlias / /usr/lib/git-core/git-http-backend/

<Directory /home/git>
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>

# Require authentication to all repositories
<Location />
AuthBasicProvider internal
AuthType Basic
AuthName "Git"
Require valid-user
</Location>

# Allow both internal and client users to access this repository.
<Location /client-repo.git>
AuthBasicProvider internal clients
AuthType Basic
AuthName "Git"
Require valid-user
</Location>
</VirtualHost>

If all the options there could be available that would be awesome.
Regards.
blackstar
 
Posts: 59
Joined: Thu Apr 25, 2013 3:37 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby James.W@AST » Tue May 14, 2013 9:29 am

Hi blackstar,

Thanks. We will see what we can do : )
To Infinity and Beyond!

Friends of My AS-606T: (RAID 5 with WD Black 2TB * 4, WD Red 2TB * 2)
MacBook Air (10.8) & Self-assembled Windows PC (Windows 7)
iPhone 4S (iOS 6) & iPad 2 (iOS 6)
Boxee Box, Logitech Squeezebox Duet
SONY HT-CT150 Sound Bar (Connected directly to the NAS via HDMI)
CISCO Linksys E4200
User avatar
James.W@AST
 
Posts: 189
Joined: Wed Jun 06, 2012 12:50 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby blackstar » Fri May 17, 2013 9:21 pm

Hi,
Thanks.
Also I had another question, is the apache server run with the usual user/group ( www-data:www-data) ? Or is there any specifities there also ?
blackstar
 
Posts: 59
Joined: Thu Apr 25, 2013 3:37 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby blackstar » Mon Sep 02, 2013 2:54 am

Hi,
Coming back on this topic after a while because I did not have time to look for another way to serve git over http from the NAS but here's something I found (http://www.jedi.be/blog/2009/05/06/8-wa ... apachehttp)

It uses "DAV on" directive and htpasswd files to serve git over apache httpd with baic htpasswd authentication.

Would this work on the asustor ? Is there any thing special to do to get it working ?

Cheers.
blackstar
 
Posts: 59
Joined: Thu Apr 25, 2013 3:37 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby blackstar » Tue Sep 03, 2013 9:05 pm

Hi,

Could I get an answer please ?

Cheers
blackstar
 
Posts: 59
Joined: Thu Apr 25, 2013 3:37 am

Re: [HOWTO] Keep custom Virtual Hosts configs

Postby blackstar » Sat Nov 16, 2013 12:17 am

Hello.

Can we get a feedback on that topic. any plans on implementing this or not ? If so , when can we expect it ?
blackstar
 
Posts: 59
Joined: Thu Apr 25, 2013 3:37 am

Return to Web Hosting

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 1 guest