Userdir Access On ISPConfig 3 Server
|
Submitted by MaddinXx (Contact Author) (Forums) on Wed, 2012-08-22 17:12. :: ISPConfig | Web Server | Apache | Control Panels
Userdir Access On ISPConfig3 Server
Version 1.0
This tutorial describes how you can enable userdir based access on your ISPConfig3 server running apache2. At the end, your clients will be able to access their site via http://yourdomain.tld/~clientdomain.tld I do not issue any guarantee that this will work for you!
1 RequirementsTo follow this tutorial you will need the following:
2 Preparing Apache2Before we can install the ISPConfig3 plugin, we have to prepare the apache2 webserver. It's very easy. First of all, you have to enabled the mod_userdir module by typing: a2enmod userdir Since we don't want to use the modules default configuration, we simply delete it's content (otherwise usedir access would be possible from all domains): echo "" > /etc/apache2/mods-available/userdir.conf However, apache2 now doesn't have a config for userdir anymore, so we add it again. Open the file /etc/apache2/sites-available/default with an editor of your choice (e.g. nano) and append the following lines within the vhost directive: [...]
<IfModule mod_userdir.c>
UserDir /var/www/*/web
UserDir disabled
Include /etc/apache2/userdirs-enabled/*
<Directory /var/www/*/web>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
# Disallow PHP file access
<Files ~ '.php[s3-6]{0,1}$'>
Order allow,deny
Deny from all
Allow from none
</Files>
</Directory>
</IfModule>
[...]
and save the file. Last but not least we need to create two folders into which the plugin will save it's files (equal to sites-available and sites-enabled):
mkdir /etc/apache2/userdirs-available Finally, restart apache: /etc/init.d/apache2 restart
3 Installing The PluginNow it's time to install the plugin itself, as for now, userdir doesn't to anything.
Download The PluginIt's always good to have temporary files within /tmp so go there: cd /tmp and download the plugin: wget https://github.com/Rackster/ispconfig3-userdir/zipball/stable
Note that the last part of the URL (e.g *stable*) stands for the branch. Now, unpack the files by running:
unzip stable
Copy The FilesOK, as you now have all the file on the server's disk, it's time to copy them to the correct paths. Therefore we first change into the newly created folder: cd Rackster-ispconfig3-userdir-* and copy the files:
cp usr/local/ispconfig/server/plugins-available/apache2_userdir_plugin.inc.php /usr/local/ispconfig/server/plugins-available/ Do the same for all files within the interface folder. You may need to delete existing files first. If your setup is already modified, it might be smart to manually apply the changes. To do so, just take a loot at https://github.com/Rackster/ispconfig3-userdir/commit/777177b6c768c1f3777bf7d70443e3f8483820b8 to see what files were changed. Done! We no longer need the downloaded files, so we can delete them: rm -rf /tmp/Rackster-ispconfig3-userdir-* However, the plugin uses a class which was taken from another plugin, so you have to create a folder and file for it to work: mkdir /usr/local/ispconfig/server/plugins-available/classes and create a file called vhost.php within this folder: nano /usr/local/ispconfig/server/plugins-available/classes/vhost.php and paste the content of this file into it: https://raw.github.com/Rackster/ispconfig3-nginx-reverse-proxy/master/usr/local/ispconfig/server/plugins-available/classes/vhost.php
Add The DB FieldThe plugin needs another field in the ISPConfig Database, you have to create it. The easiest way is to login into phpMyAdmin: select ISPConfig DB -> select table web_domain -> add new field after "errordocs" -> name: userdir, type: tinyint, length: 1, default: 0
CHMOD The FilesJust run:
chmod 750 /usr/local/ispconfig/server/conf/apache2_userdir.conf.master to set correct rights.
Enable The PluginISPConfig looks in /usr/local/ispconfig/server/plugins-enabled for enabled plugins, so we have to create a symlink there:
cd /usr/local/ispconfig/server/plugins-enabled/ That's all!
4 Using The PluginIf you followed all steps from above, you should now see another "field" called Temporary URL within the sites module. To enable userdir based access for a domain, just activate the checkbox next to it. The client will then be able to access his site by typing: http://yourdomain.tld/~hisdomain.tld in the browser.
5 Notes
6 Links
|



Recent comments
2 hours 51 min ago
3 hours 51 min ago
7 hours 38 min ago
8 hours 52 min ago
12 hours 28 min ago
19 hours 43 min ago
1 day 4 hours ago
1 day 6 hours ago
1 day 21 hours ago
1 day 23 hours ago