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
Is straight-up writing someone's opinions telling?
How should one refer to knights (& dames) in academic writing?
Why doesn't philosophy have higher standards for its arguments?
Do dragons smell of lilacs?
Is this Android phone Android 9.0 or Android 6.0?
How to make a plagal cadence sound convincing as an ending?
What "fuel more powerful than anything the West (had) in stock" put Laika in orbit aboard Sputnik 2?
Why does FFmpeg choose 10+20+20 ms instead of an even 16 ms for 60 fps GIF images?
Vienna To Graz By Rail
What happens if there is no space for entry stamp in the passport for US visa?
What were the problems on the Apollo 11 lunar module?
Where do the electrons come from to make the carbon stable during bombardment of alpha particles on beryllium
Why is Katakana not pronounced Katagana?
What does it actually mean to have two time dimensions?
Does the Intel 8085 CPU use real memory addresses?
Can a Resident Assistant be told to ignore a lawful order?'
What prompted Cuba to fight against South African Imperialism?
ROT13 encoder/decoder
Mortgage as present value of resale worth
Was Apollo 13 radio blackout on reentry longer than expected?
Kepler space telescope undetected planets
Where did "a racist bone in [one's] body" and "a mean bone in [one's] body" come from?
Is it ethical for a company to ask its employees to move furniture on a weekend?
Did Voldemort kill his father before finding out about Horcruxes?
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;
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
add a comment |
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
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
add a comment |
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
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
php apache centos7
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
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
|
show 3 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
|
show 3 more comments
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
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
|
show 3 more comments
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
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
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
|
show 3 more comments
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
|
show 3 more comments
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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