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;








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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해