PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 21, 2022

[FIXED] How to configure linux/apache for multiple virtualhost in local machine

 September 21, 2022     apache, debian, linux, ubuntu, virtualhost     No comments   

Issue

I have two local web site project, localgoogle.com and localapple.com.

localgoogle.com files are in /home/vahid/dev/localgoogle

localapple.com files are in /home/vahid/dev/localapple

My OS is debian 8.5, I have apache2 installed.

I made /etc/apache2/sites-available/localgoogle.com.conf

and /etc/apache2/sites-available/localapple.com.conf

both linked to /etc/apache2/sites-enabled and enabled by a2ensite command.

This is localgoole.com.conf:

<VirtualHost *:80>
    ServerName localgoogle.com
    ServerAdmin webmaster@localgoogle.com
    DocumentRoot /home/vahid/dev/localgoogle
    ServerAlias www.localgoogle.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

localapple conf file follow above configuration rule.

I restarted apache2 service, but I don't know why and how to access this virtualhosts from browser!

I tried localhost/localgoogle.com in browser but It's return Not Found


Solution

You access the site directly as localgoogle.com from your browser. Make sure that the name resolves to your local ip address using hosts file or dns.



Answered By - varun
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing