How to configure two local projects in CentOS ApacheDifference between the Apache HTTP Server and Apache Tomcat?UTF-8 all the way throughHow do I implement basic “Long Polling”?How to calculate the difference between two dates using PHP?startsWith() and endsWith() functions in PHPHow to enable mod_rewrite for Apache 2.2Get the first element of an arrayReference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Lost httpd.conf file located apache

How to color a tag in a math equation?

Is this artwork (used in a video game) real?

Is it legal for a supermarket to refuse to sell an adult beer if an adult with them doesn’t have their ID?

Why is Google approaching my VPS machine?

How could an animal "smell" carbon monoxide?

Which GPUs to get for Mathematical Optimization (if any...)?

What would be the safest way to drop thousands of small, hard objects from a typical, high wing, GA airplane?

Is this Android phone Android 9.0 or Android 6.0?

Does inertia keep a rotating object rotating forever, or something else?

Do dragons smell of lilacs?

What does it actually mean to have two time dimensions?

what relax command means?

Why don't commercial aircraft adopt a slightly more seaplane-like design to allow safer ditching in case of emergency?

Vienna To Graz By Rail

Optimising the Selection of MaxValue in Association

Is passive Investigation essentially truesight against illusions?

What "fuel more powerful than anything the West (had) in stock" put Laika in orbit aboard Sputnik 2?

Cauchy reals and Dedekind reals satisfy "the same mathematical theorems"

Why did Steve Rogers choose this character in Endgame?

How should one refer to knights (& dames) in academic writing?

What is the point of a constraint expression on a non-templated function?

Where do the electrons come from to make the carbon stable during bombardment of alpha particles on beryllium

At which point can a system be compromised when downloading archived data from an untrusted source?

Migrating Configuration - 3750G to 3750X



How to configure two local projects in CentOS Apache


Difference between the Apache HTTP Server and Apache Tomcat?UTF-8 all the way throughHow do I implement basic “Long Polling”?How to calculate the difference between two dates using PHP?startsWith() and endsWith() functions in PHPHow to enable mod_rewrite for Apache 2.2Get the first element of an arrayReference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Lost httpd.conf file located apache






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have two local projects using Apache and CentOS 7.
I would like to run two projects simultaneously.
How to configure apache config?










share|improve this question
























  • I use first project <VirtualHost *:80> and ServerName localhost. I do second project <VirtualHost *:81> and ServerName localhost:81. It works localhost but doesn't do localhost:81.

    – David Kham
    Mar 26 at 9:24

















0















I have two local projects using Apache and CentOS 7.
I would like to run two projects simultaneously.
How to configure apache config?










share|improve this question
























  • I use first project <VirtualHost *:80> and ServerName localhost. I do second project <VirtualHost *:81> and ServerName localhost:81. It works localhost but doesn't do localhost:81.

    – David Kham
    Mar 26 at 9:24













0












0








0








I have two local projects using Apache and CentOS 7.
I would like to run two projects simultaneously.
How to configure apache config?










share|improve this question
















I have two local projects using Apache and CentOS 7.
I would like to run two projects simultaneously.
How to configure apache config?







php apache centos7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 9:15







David Kham

















asked Mar 26 at 9:02









David KhamDavid Kham

51 silver badge6 bronze badges




51 silver badge6 bronze badges












  • I use first project <VirtualHost *:80> and ServerName localhost. I do second project <VirtualHost *:81> and ServerName localhost:81. It works localhost but doesn't do localhost:81.

    – David Kham
    Mar 26 at 9:24

















  • I use first project <VirtualHost *:80> and ServerName localhost. I do second project <VirtualHost *:81> and ServerName localhost:81. It works localhost but doesn't do localhost:81.

    – David Kham
    Mar 26 at 9:24
















I use first project <VirtualHost *:80> and ServerName localhost. I do second project <VirtualHost *:81> and ServerName localhost:81. It works localhost but doesn't do localhost:81.

– David Kham
Mar 26 at 9:24





I use first project <VirtualHost *:80> and ServerName localhost. I do second project <VirtualHost *:81> and ServerName localhost:81. It works localhost but doesn't do localhost:81.

– David Kham
Mar 26 at 9:24












1 Answer
1






active

oldest

votes


















0














you can configure two different virtual hosts on the same port but with different server names



<VirtualHost *:80>
ServerName project1.local
DocumentRoot /var/www/project1
</VirtualHost>

<VirtualHost *:80>
ServerName project2.local
DocumentRoot /var/www/project2
</VirtualHost>


then add the following line to your /etc/hosts



127.0.0.1 project1.local project2.local


then in your browser you should be able to access the two projects on http://project1.local and http://project2.local






share|improve this answer























  • how to call project1.local from another PC?

    – David Kham
    Mar 26 at 10:27






  • 1





    Make sure that your system has a ip address which is accessable from the outside and apache is listining on that. Then just change the /etc/hosts to the accessable ip address and install that line on all needed end-devices.

    – eiskaltereistee
    Mar 26 at 13:19











  • like eiskaltereistee said, you should add the line to /etc/hosts of other machines but replace 127.0.0.1 with your network accessible IP.

    – Zaid Amireh
    Mar 26 at 17:16











  • IP address works only one project. How to make for two projects?

    – David Kham
    Mar 27 at 0:26











  • I'm not sure where you got this assumption 'IP address works only one project.', VirtualHost'ing was created to serve multiple sites using the same IP. Did you try the above? Are you having any issues?

    – Zaid Amireh
    Mar 27 at 10:03











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353228%2fhow-to-configure-two-local-projects-in-centos-apache%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














you can configure two different virtual hosts on the same port but with different server names



<VirtualHost *:80>
ServerName project1.local
DocumentRoot /var/www/project1
</VirtualHost>

<VirtualHost *:80>
ServerName project2.local
DocumentRoot /var/www/project2
</VirtualHost>


then add the following line to your /etc/hosts



127.0.0.1 project1.local project2.local


then in your browser you should be able to access the two projects on http://project1.local and http://project2.local






share|improve this answer























  • how to call project1.local from another PC?

    – David Kham
    Mar 26 at 10:27






  • 1





    Make sure that your system has a ip address which is accessable from the outside and apache is listining on that. Then just change the /etc/hosts to the accessable ip address and install that line on all needed end-devices.

    – eiskaltereistee
    Mar 26 at 13:19











  • like eiskaltereistee said, you should add the line to /etc/hosts of other machines but replace 127.0.0.1 with your network accessible IP.

    – Zaid Amireh
    Mar 26 at 17:16











  • IP address works only one project. How to make for two projects?

    – David Kham
    Mar 27 at 0:26











  • I'm not sure where you got this assumption 'IP address works only one project.', VirtualHost'ing was created to serve multiple sites using the same IP. Did you try the above? Are you having any issues?

    – Zaid Amireh
    Mar 27 at 10:03
















0














you can configure two different virtual hosts on the same port but with different server names



<VirtualHost *:80>
ServerName project1.local
DocumentRoot /var/www/project1
</VirtualHost>

<VirtualHost *:80>
ServerName project2.local
DocumentRoot /var/www/project2
</VirtualHost>


then add the following line to your /etc/hosts



127.0.0.1 project1.local project2.local


then in your browser you should be able to access the two projects on http://project1.local and http://project2.local






share|improve this answer























  • how to call project1.local from another PC?

    – David Kham
    Mar 26 at 10:27






  • 1





    Make sure that your system has a ip address which is accessable from the outside and apache is listining on that. Then just change the /etc/hosts to the accessable ip address and install that line on all needed end-devices.

    – eiskaltereistee
    Mar 26 at 13:19











  • like eiskaltereistee said, you should add the line to /etc/hosts of other machines but replace 127.0.0.1 with your network accessible IP.

    – Zaid Amireh
    Mar 26 at 17:16











  • IP address works only one project. How to make for two projects?

    – David Kham
    Mar 27 at 0:26











  • I'm not sure where you got this assumption 'IP address works only one project.', VirtualHost'ing was created to serve multiple sites using the same IP. Did you try the above? Are you having any issues?

    – Zaid Amireh
    Mar 27 at 10:03














0












0








0







you can configure two different virtual hosts on the same port but with different server names



<VirtualHost *:80>
ServerName project1.local
DocumentRoot /var/www/project1
</VirtualHost>

<VirtualHost *:80>
ServerName project2.local
DocumentRoot /var/www/project2
</VirtualHost>


then add the following line to your /etc/hosts



127.0.0.1 project1.local project2.local


then in your browser you should be able to access the two projects on http://project1.local and http://project2.local






share|improve this answer













you can configure two different virtual hosts on the same port but with different server names



<VirtualHost *:80>
ServerName project1.local
DocumentRoot /var/www/project1
</VirtualHost>

<VirtualHost *:80>
ServerName project2.local
DocumentRoot /var/www/project2
</VirtualHost>


then add the following line to your /etc/hosts



127.0.0.1 project1.local project2.local


then in your browser you should be able to access the two projects on http://project1.local and http://project2.local







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 9:42









Zaid AmirehZaid Amireh

713 bronze badges




713 bronze badges












  • how to call project1.local from another PC?

    – David Kham
    Mar 26 at 10:27






  • 1





    Make sure that your system has a ip address which is accessable from the outside and apache is listining on that. Then just change the /etc/hosts to the accessable ip address and install that line on all needed end-devices.

    – eiskaltereistee
    Mar 26 at 13:19











  • like eiskaltereistee said, you should add the line to /etc/hosts of other machines but replace 127.0.0.1 with your network accessible IP.

    – Zaid Amireh
    Mar 26 at 17:16











  • IP address works only one project. How to make for two projects?

    – David Kham
    Mar 27 at 0:26











  • I'm not sure where you got this assumption 'IP address works only one project.', VirtualHost'ing was created to serve multiple sites using the same IP. Did you try the above? Are you having any issues?

    – Zaid Amireh
    Mar 27 at 10:03


















  • how to call project1.local from another PC?

    – David Kham
    Mar 26 at 10:27






  • 1





    Make sure that your system has a ip address which is accessable from the outside and apache is listining on that. Then just change the /etc/hosts to the accessable ip address and install that line on all needed end-devices.

    – eiskaltereistee
    Mar 26 at 13:19











  • like eiskaltereistee said, you should add the line to /etc/hosts of other machines but replace 127.0.0.1 with your network accessible IP.

    – Zaid Amireh
    Mar 26 at 17:16











  • IP address works only one project. How to make for two projects?

    – David Kham
    Mar 27 at 0:26











  • I'm not sure where you got this assumption 'IP address works only one project.', VirtualHost'ing was created to serve multiple sites using the same IP. Did you try the above? Are you having any issues?

    – Zaid Amireh
    Mar 27 at 10:03

















how to call project1.local from another PC?

– David Kham
Mar 26 at 10:27





how to call project1.local from another PC?

– David Kham
Mar 26 at 10:27




1




1





Make sure that your system has a ip address which is accessable from the outside and apache is listining on that. Then just change the /etc/hosts to the accessable ip address and install that line on all needed end-devices.

– eiskaltereistee
Mar 26 at 13:19





Make sure that your system has a ip address which is accessable from the outside and apache is listining on that. Then just change the /etc/hosts to the accessable ip address and install that line on all needed end-devices.

– eiskaltereistee
Mar 26 at 13:19













like eiskaltereistee said, you should add the line to /etc/hosts of other machines but replace 127.0.0.1 with your network accessible IP.

– Zaid Amireh
Mar 26 at 17:16





like eiskaltereistee said, you should add the line to /etc/hosts of other machines but replace 127.0.0.1 with your network accessible IP.

– Zaid Amireh
Mar 26 at 17:16













IP address works only one project. How to make for two projects?

– David Kham
Mar 27 at 0:26





IP address works only one project. How to make for two projects?

– David Kham
Mar 27 at 0:26













I'm not sure where you got this assumption 'IP address works only one project.', VirtualHost'ing was created to serve multiple sites using the same IP. Did you try the above? Are you having any issues?

– Zaid Amireh
Mar 27 at 10:03






I'm not sure where you got this assumption 'IP address works only one project.', VirtualHost'ing was created to serve multiple sites using the same IP. Did you try the above? Are you having any issues?

– Zaid Amireh
Mar 27 at 10:03









Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353228%2fhow-to-configure-two-local-projects-in-centos-apache%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript