Return to Snippet

Revision: 3592
at August 20, 2007 04:36 by micmath


Updated Code
// edit httpd.conf or some included apache configuration file...

<VirtualHost *:80>
  ServerName local.mysite.com
  DocumentRoot /usr/local/Sites/local.mysite.com/public_html
  ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
  CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
  ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
  AllowOverride all
  Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

// then...

$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl configtest
$ sudo apachectl restart

// to give apache access to a folder in your home dir...

$ sudo gpasswd -a apache yourgroup

// otherwise make sure that the directory containing your HTML files and each of its parent directories has chmod o+x set on it

Revision: 3591
at August 20, 2007 04:32 by micmath


Updated Code
// edit httpd.conf or some included apache configuration file...

ServerName 127.0.0.1
NameVirtualHost *

<VirtualHost *>
  ServerName local.mysite.com
  DocumentRoot /usr/local/Sites/local.mysite.com/public_html
  ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
  CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
  ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
  AllowOverride all
  Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

// then...

$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl configtest
$ sudo apachectl restart

// to give apache access to a folder in your home dir...

$ sudo gpasswd -a apache yourgroup

// otherwise make sure that the directory containing your HTML files and each of its parent directories has chmod o+x set on it

Revision: 3590
at August 20, 2007 04:28 by micmath


Updated Code
// edit httpd.conf or some included apache configuration file...

ServerName 127.0.0.1
NameVirtualHost *

<VirtualHost *>
  ServerName local.mysite.com
  DocumentRoot /usr/local/Sites/local.mysite.com/public_html
  ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
  CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
  ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
  AllowOverride all
  Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

// then...

$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl configtest
$ sudo apachectl restart

// to give apache access to a folder in your home dir...

$ sudo gpasswd -a apache yourgroup

Revision: 3589
at August 20, 2007 04:27 by micmath


Updated Code
// edit httpd.conf or some included apache configuration file...

ServerName 127.0.0.1
NameVirtualHost *

<VirtualHost *>
  ServerName local.mysite.com
  DocumentRoot /usr/local/Sites/local.mysite.com/public_html
  ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
  CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
  ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
  AllowOverride all
  Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

// then...

$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl configtest
$ sudo apachectl restart

// to give apache access to a folder in your home dir...

$ sudo gpasswd users -a apache yourgroup

Revision: 3588
at August 18, 2007 07:36 by micmath


Updated Code
# edit httpd.conf or some included apache configuration file...

ServerName 127.0.0.1
NameVirtualHost *

<VirtualHost *>
  ServerName local.mysite.com
  DocumentRoot /usr/local/Sites/local.mysite.com/public_html
  ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
  CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
  ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
  AllowOverride all
  Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

# then...

$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl configtest
$ sudo apachectl restart

Revision: 3587
at August 18, 2007 07:34 by micmath


Updated Code
# edit httpd.conf or some included apache configuration file...

ServerName 127.0.0.1
NameVirtualHost *

<VirtualHost *>
  ServerName local.mysite.com
  DocumentRoot /usr/local/Sites/local.mysite.com/public_html
  ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
  CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
  ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
  AllowOverride FileInfo AuthConfig Limit Indexes
  Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

# then...

$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl configtest
$ sudo apachectl restart

Revision: 3586
at August 18, 2007 07:31 by micmath


Initial Code
# edit httpd.conf or some included apache configuration file...

ServerName 127.0.0.1
NameVirtualHost *

<VirtualHost *>
  ServerName local.mysite.com
  DocumentRoot /usr/local/Sites/local.mysite.com/public_html
  ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
  CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
  ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
  AllowOverride FileInfo AuthConfig Limit Indexes
  Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

# then...

$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl restart

Initial URL

                                

Initial Description

                                

Initial Title
Set up a local virtual host website

Initial Tags
apache

Initial Language
Other