Skip to content

Instantly share code, notes, and snippets.

@jansanchez
Last active December 30, 2015 22:19
Show Gist options
  • Save jansanchez/7893350 to your computer and use it in GitHub Desktop.
Save jansanchez/7893350 to your computer and use it in GitHub Desktop.
Local domain settings: local.dominio.pe

Local domain settings: local.dominio.pe

Type in your terminal

sudo vim /etc/apache2/sites-available/local.dominio.pe

Edit the file adding the next content

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName local.dominio.pe

DocumentRoot ~/htdocs/dominio/src/public

<Directory ~/htdocs/dominio/src/public>
        SetEnv APPLICATION_ENV development
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
</Directory>
<Directory />
        Options FollowSymLinks
        AllowOverride None
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
        AllowOverride FileInfo
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/local.dominio.pe-error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/local.dominio.pe-access.log combined


</VirtualHost>

Type in your terminal(pass from sites-available to sites-enabled)

sudo a2ensite local.dominio.pe

Later...

sudo service apache2 restart

Open /etc/hosts

sudo vim /etc/hosts

And add ...

127.0.0.1 local.dominio.pe

It will look like

127.0.0.1       localhost
127.0.1.1       ftpi

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.0.1 local.dominio.pe

Finally add your new domain to web browser

local.dominio.pe

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment