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/

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
1111 [ 一日30分 인생승리의 학습법] KoELECTRA로 기계독해(MRC) API 개발 file 졸리운_곰 2023.01.01 7
1110 [ 一日30分 인생승리의 학습법] 일 안 해도 생기는 수입? 그런 ‘패시브 인컴’은 없다 file 졸리운_곰 2023.01.01 6
1109 [ 一日30分 인생승리의 학습법] Qemu를 이용한 가상화 기초 file 졸리운_곰 2022.12.31 5
1108 [ 一日30分 인생승리의 학습법] 파이토치로 딥러닝해야 하는 5가지 이유 졸리운_곰 2022.12.31 6
1107 [ 一日30分 인생승리의 학습법] 왜 ‘한국어’의 자연어처리(NLP)는 유독 어려울까? file 졸리운_곰 2022.12.31 10
1106 [ 一日30分 인생승리의 학습법] MinIO Windows Service 등록 졸리운_곰 2022.12.24 7
1105 [ 一日30分 인생승리의 학습법] Apache 2.2에서 2.4로 마이그레이션 시 발생하는 에러 및 해결책 정리 졸리운_곰 2022.12.18 6
1104 [ 一日30分 인생승리의 학습법] Git 사용 방법 정리(commit, push, pull request, merge 등) 졸리운_곰 2022.12.04 18
1103 [ 一日30分 인생승리의 학습법] [웹 기획] 화면 설계 용어 - 와이어프레임, 스토리보드, 프로토타입의 차이점 file 졸리운_곰 2022.12.03 6
1102 [ 一日30分 인생승리의 학습법] REST API 설계 (네이밍) 졸리운_곰 2022.11.26 22
1101 [ 一日30分 인생승리의 학습법] REST API URI 규칙 졸리운_곰 2022.11.26 12
1100 [ 一日30分 인생승리의 학습법 ] REST API URL 규칙 졸리운_곰 2022.11.26 9
1099 [ 一日30分 인생승리의 학습법 ] prolog 문법 : Prolog Syntax 졸리운_곰 2022.11.21 3
1098 [ 一日30分 인생승리의 학습법 ] noVNC 작동원리 file 졸리운_곰 2022.11.16 6
1097 [ 一日30分 인생승리의 학습법 ] 프로젝트 만들고 GitHub에 첫 Commit하고 Push하기 file 졸리운_곰 2022.11.15 4
1096 [ 一日30分 인생승리의 학습법 ] 우분투(리눅스) 에서 EBS 라디오 자동녹음 만들기 졸리운_곰 2022.11.11 9
1095 [ 一日30分 인생승리의 학습법 ] EBS FM 라디오, rtmp 서비스 중단 졸리운_곰 2022.11.11 9
1094 [ 一日30分 인생승리의 학습법 ] 악보 읽는 방법 file 졸리운_곰 2022.11.08 12
1093 [ 一日30分 인생승리의 학습법 ] 13가지 주요 오픈소스 프로젝트 file 졸리운_곰 2022.10.09 15
1092 [ 一日30分 인생승리의 학습법 ] 극상의 학습 난이도로 입문자 울리는 프로그래밍 언어 Top 10 졸리운_곰 2022.09.03 15
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED