Xampp virtualhost setting not working : Xampp Virtual Host: How to configure Virtual Host in Xampp

Xampp Virtual Host: How to configure Virtual Host in Xampp

Some time ago I installed Windows 10 next to my beloved Open Suse. Sensing the opening knives in the pockets of the Linux community I will defend myself that I need it for C# and .NET exercises. Sometimes, however, it makes no sense to switch between systems, so to quickly put something locally, you could use a virtual host on Xampp.

So now you nervously type in Google “xampp virtual host” and now I will answer to you ????

What is Virtual Host

By Virtual Host we mean hosting multiple domains on one server. So you need a virtual address that will behave exactly like on the Internet. Thanks to this you will be able to use absolute paths. Typed “/” will refer to root, which is the directory where the domain is parked.

Setting up and configuring Xampp Virtual Host

To start with, if you have already tried to change something in Xampp files, delete it, remove any leftovers and reinstall the latest version. In the meantime, create a folder for virtual hosts (pages that you will have in parallel). In this case, I did it directly on disk C, under the name “vhost”.

Make sure the new Xampp is turned off. For convenience, I create shortcuts on the desktop for files and folders, which I will sometimes edit:

  • hosts (C:\Windows\System32\drivers\etc)
  • Directory vhost (C:\vhost)
  • Directory htdocs (C:\xampp\htdocs)
  • httpd-vhosts.conf (C:\xampp\apache\conf\extra\httpd-vhosts.conf)

At first open the file httpd.conf (C:\xampp\apache\conf\httpd.conf) and search for the code below:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

Change “none” to “all”.

<Directory />
    AllowOverride all
    Require all denied
</Directory>

Save file. Open the “vhost” directory you created earlier and add subdirectories for the files of the new sites. Let’s assume that we want to add two new websites: strona1.pl and strona2.pl.

Vitual Host how to bet Virtual Host

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

Now open file httpd-vhosts.conf (C:\xampp\apache\conf\extra\httpd-vhosts.conf) and add virtual hosts with the following configuration scheme:

<VirtualHost *>
DocumentRoot "c:/vhost/strony1"
ServerName strony1.pl
ServerAlias www.strony1.pl
<Directory "c:/vhost/strony1">
    AllowOverride All
    Require all granted
</Directory>
</VirtualHost>

<VirtualHost *>
DocumentRoot "c:/vhost/strony2"
ServerName strony2.pl
ServerAlias www.strony2.pl
<Directory "c:/vhost/strony2">
    AllowOverride All
    Require all granted
</Directory>
</VirtualHost>

If you have the commented code above, make sure the line listed is not commented out and you removed the port:

NameVirtualHost *

Finally, assign the IP to the domain. Open the hosts file (C:\Windows\System32\drivers\etc) and add two lines at the end:

127.0.0.1 strony1.pl
127.0.0.1 strony2.pl

Now your xampp virtual host is ready. ???? Restart the browser. After placing the files in the appropriate directories and enabling Xampp, you will be able to conveniently operate on several locally placed pages simultaneously.

 

[출처] https://royalcode.eu/en/how-to-configure-virtual-host-in-xampp/

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
1140 [ 一日30分 인생승리의 학습법] [ git 기본 ] 브랜치 전환하기 file 졸리운_곰 2023.07.06 41
1139 [ 一日30分 인생승리의 학습법] [ git 기본 ] git pull 시 특정 branch 를 pull 해오기 졸리운_곰 2023.07.06 40
1138 [ 一日30分 인생승리의 학습법] 웹서버의 mht 파일 웹 배포 how to load by browser remote mht file // Reading .mht webpages from server 졸리운_곰 2023.06.05 487
1137 [ 一日30分 인생승리의 학습법] WebGPU Graphics Programming: Step-by-Step file 졸리운_곰 2023.05.30 57
1136 [ 一日30分 인생승리의 학습법] Git으로 실행취소(Undo)하는 거의 모든 방법 file 졸리운_곰 2023.05.07 39
1135 [ 一日30分 인생승리의 학습법] [git] [초보용] Git 되돌리기( Reset, Revert ) 졸리운_곰 2023.05.07 51
1134 [ 一日30分 인생승리의 학습법] 피그마 사용법과 협업하기(개발자 시점) file 졸리운_곰 2023.04.25 37
1133 [ 一日30分 인생승리의 학습법] ChatGPT를 비롯한 대화형 AI 서비스에서 더 좋은 결과물을 얻게 해주는 프롬프트 엔지니어링 (Prompt Engineering) file 졸리운_곰 2023.04.10 77
1132 [ 一日30分 인생승리의 학습법] 딥러닝 관련 강의, 자료, 읽을거리들에 대한 모음입니다. 졸리운_곰 2023.04.02 46
1131 [ 一日30分 인생승리의 학습법] 확실히 알아두면 만사가 편해지는 머신러닝 10가지 알고리즘 file 졸리운_곰 2023.04.01 46
1130 [ 一日30分 인생승리의 학습법] [머신러닝] 분류 알고리즘 한 페이지 정리(로지스틱회귀, SVM, KNN, file 졸리운_곰 2023.04.01 47
1129 [ 一日30分 인생승리의 학습법] ChatGPT로 10분만에 웹사이트 만들기 : 링크 및 자료 모음 졸리운_곰 2023.04.01 55
1128 [ 一日30分 인생승리의 학습법] AI Code Helper chatgpt vscode 플러그인 plugin file 졸리운_곰 2023.04.01 69
1127 [ 一日30分 인생승리의 학습법] 데이터 활용 시대의 필수 역량, 데이터 리터러시 제대로 하는 3가지 방법 file 졸리운_곰 2023.03.30 26
1126 [ 一日30分 인생승리의 학습법] 데이터 리터러시(Data Literacy)를 올리는 방법 file 졸리운_곰 2023.03.30 50
1125 [ 一日30分 인생승리의 학습법] 도커를 이용해 쉽게 IRC 서버 구축하기 file 졸리운_곰 2023.03.25 36
1124 [ 一日30分 인생승리의 학습법] IRC 사용법 졸리운_곰 2023.03.25 35
1123 [ 一日30分 인생승리의 학습법] [서비스] IRC 서버 구축 방법 졸리운_곰 2023.03.25 34
1122 [ 一日30分 인생승리의 학습법] 베이그런트(Vagrant) 튜토리얼, 개발 환경 공유와 가상 머신 관리를 위한 커맨드라인 도구 졸리운_곰 2023.03.10 70
1121 [ 一日30分 인생승리의 학습법] 나만 알고싶은 Vagrant 사용법 file 졸리운_곰 2023.03.10 35
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED