http://ip/~username doesn't work

Resulting in ip/~user working again, BUT all requests under ip/~user are then under the user apache. Normal requests at domains are still under the user.

So I figured its either having ip/~user working with user apache, or have it not working.
Configure mod_ruid2 in stat mode for IP requests and things start working again.
 
There are lots of threads here discussing mod_ruid2, at least one How-To. Look for mod_ruid, not mod_ruid2 as I doin't recall under which it's posted.

Jeff
 
I've created the file ips_virtual_host.conf in the custom directory and restarted the Apache but I still can't access to sits through the IP.

This is the file content:
Code:
<VirtualHost |IP|:80>
    ServerName shared.domain
    ScriptAliasMatch ^/~([^/]+)/+cgi-bin/+(.*) /home/$1/public_html/cgi-bin/$2
    AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
    DocumentRoot |DOCROOT|
|*if APACHE_VER="2.0"|
    #SuexecUserGroup |USER| |GROUP|
    RMode config
    RUidGid apache access
    RGroups apache 
|*else|
    User |USER|
    Group |GROUP|
|*endif|
    CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost |IP|:443>
    SSLEngine on
    SSLCertificateFile |CERT|
    SSLCertificateKeyFile |KEY|
    ServerName shared.domain
    ScriptAliasMatch ^/~([^/]+)/+cgi-bin/+(.*) /home/$1/public_html/cgi-bin/$2
    AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
    DocumentRoot |DOCROOT|
|*if APACHE_VER="2.0"|
    #SuexecUserGroup |USER| |GROUP|
    RMode config
    RUidGid apache apache
    RGroups apache 
|*else|
    User |USER|
    Group |GROUP|
|*endif|
    CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

and what you meant by "edit IPs in Directadmin afterwards"?

there is something im missing.. this template craete /etc/http/conf/ips.conf?

So, why mine ips.conf doesnt have virtualhost?

Code:
# Auto generated apache config file by DirectAdmin version 1.38.2
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

LogFormat "%O \"%r\"" homedir
NameVirtualHost 89.97.218.93:80
NameVirtualHost 89.97.218.93:443

Ive just edited /usr/local/directadmin/data/templates/custom/httpd.conf
and
/etc/httpd/conf/httpd.conf

moving Group apache to Group access

And the IP/~username is working properly... so my question is, this custom ips_virtualhost.conf file, what is needed (and/or suggested) to edit for?

Thanks
 
there is something im missing.. this template craete /etc/http/conf/ips.conf?

So, why mine ips.conf doesnt have virtualhost?

Code:
# Auto generated apache config file by DirectAdmin version 1.38.2
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

LogFormat "%O \"%r\"" homedir
NameVirtualHost 89.97.218.93:80
NameVirtualHost 89.97.218.93:443
Ive just edited /usr/local/directadmin/data/templates/custom/httpd.conf
and
/etc/httpd/conf/httpd.conf

moving Group apache to Group access

And the IP/~username is working properly... so my question is, this custom ips_virtualhost.conf file, what is needed (and/or suggested) to edit for?

Thanks
@zEitEr told me to do that.


Now I've changed the group from "apache" to "access" just at:
/etc/httpd/conf/httpd.conf
and the access from the IP is working.
So you don't have to edit that file also:
/usr/local/directadmin/data/templates/custom/httpd.conf
And now I'm guessing that we have this issue because the DirectAdmin feature and not because mod_ruid2.



P.S.
I've tried to edit just the file:
/usr/local/directadmin/data/templates/custom/httpd.conf
without the original httpd.conf(that located at "/etc/httpd/conf/httpd.conf") but it didn't changed anything. So anyone know how can I fix this issue just via "custom template" in:
/usr/local/directadmin/data/templates/custom
instead of editing the original httpd.conf at:
/etc/httpd/conf/httpd.conf
?
 
Last edited:
Well edit custom template is usefull to keep edits when directadmin rewrite_confs function is called.

So, edit both is best way for sure and faster.

I had changed apache group to access aswell but i noticed (better say that customers noticed :P) that all webmail and phpmyadmin wasnt function anymore for permissions problem (webapps:webapps)

So ive decided to turn back to apache group as original for now... till this will be better explained (or fixed maybe).

Regards
 
And i still dont get what concert about ips files with virtualhost... i suppose should be virtual_host2.conf file.. but.. maybe i missed something...
 
Well edit custom template is usefull to keep edits when directadmin rewrite_confs function is called.

So, edit both is best way for sure and faster.

I had changed apache group to access aswell but i noticed (better say that customers noticed :P) that all webmail and phpmyadmin wasnt function anymore for permissions problem (webapps:webapps)

So ive decided to turn back to apache group as original for now... till this will be better explained (or fixed maybe).

Regards

For me, the phpMyAdmim & RoundCube works great without any issue.

And i still dont get what concert about ips files with virtualhost... i suppose should be virtual_host2.conf file.. but.. maybe i missed something...

Me either.
 
should you please post me the outup of

Code:
ls -l /var/www/html

and

Code:
ls -l /var/www/ | grep html

Thanks
The first output:
-rw-r--r-- 1 root root 44 Dec 13 01:16 index.html
lrwxrwxrwx 1 webapps webapps 45 Mar 20 04:03 phpMyAdmin -> /var/www/html/phpM
yAdmin-3.3.10-all-languages
drwxr-xr-x 11 webapps webapps 4096 Mar 20 04:03 phpMyAdmin-3.3.10-all-languages
-rwxr-xr-x 1 root root 68 Dec 13 02:07 redirect.php
lrwxrwxrwx 1 webapps webapps 19 Feb 17 19:47 roundcube -> roundcubemail-0.5.1
drwxr-xr-x 10 webapps webapps 4096 Feb 17 19:47 roundcubemail-0.5.1
lrwxrwxrwx 1 webapps webapps 19 Dec 13 02:53 squirrelmail -> squirrelmail-1.4
.21
drwxr-xr-x 16 webapps webapps 4096 Dec 13 02:53 squirrelmail-1.4.21

And the second:
drwxr-xr-x 5 root root 4096 Mar 20 04:03 html
 
Ok, found out what problem i had with phpmyadmin and webmail... i was using subdomain format (ex. webmail.domain.com) and i didndt set

Code:
  RMode config
  RUidGid |USER| |GROUP|
  RGroups apache


for those virtualhost

now ive set Group access to httpd.conf and is working well

Regards and thanks
 
Now ive figured out that ips_virtual_host.conf is related to /etc/httpd/conf/extra/httpd-vhosts.conf

Thanks for your interest :)

The virutalhost you posted now let server work much better then before :) (about permissions ofc)

Regards
 
RE: mod_uid2

Everything is OK
I have changed :

RUidGid apache apache
to
RUidGid apache access

in /etc/httpd/conf/extra/httpd-vhosts.conf

and now http://ip/~username works fine.

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin webmaster@localhost
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

RMode config
RUidGid apache access
RGroups apache

CustomLog /var/log/httpd/homedir.log homedir

</VirtualHost>
 
Hey guys!

I figure out how to make the access through IP to work(thanks to you ;)) and also the mod_ruid2 working perfect(I can install WordPress plugins and other stuff without providing FTP login details).

I just actually have one last question -

What's the different between:
Code:
RMode config
RUidGid apache [B]secure_access_group
[/B]RGroups [B]secure_access_group[/B]
To:
Code:
RMode config
RUidGid |USER| |GROUP|
RGroups apache
?

I just don't understand the different because as I see, there is no any changes in Permissions/Ownerships.
Also, with which one of them should I use?

Thanks!
 
Last edited:
Back
Top