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/

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
998 A Look at REST API Design Patterns file 졸리운_곰 2021.03.14 120
997 서버 확장을 위한 두 가지 방법: 스케일 아웃과 스케일 업 file 졸리운_곰 2021.03.07 83
996 [Apache Multi Domain] 아파치 멀티 도메인 : 이름기반 VirtualHost 설정 졸리운_곰 2021.02.13 541
» Xampp virtualhost setting not working : Xampp Virtual Host: How to configure Virtual Host in Xampp file 졸리운_곰 2021.02.13 91
994 XAMPP 가상호스트 설정과 도메인 연결 file 졸리운_곰 2021.02.12 143
993 텍스트를 음성 mp3로 간단하게 변환하기 (With Naver Cloud Platform) : 딥러닝 몰라도 TTS 하는 법 file 졸리운_곰 2021.02.10 127
992 시각화 대시보드 를 만들기 위해 고려해야 하는 4가지 file 졸리운_곰 2021.02.10 178
991 gRPC 훑어보기 file 졸리운_곰 2021.02.10 105
990 [MSDOS app] 하늘 3.2 file 졸리운_곰 2021.01.29 82
989 한글 인코딩 정리 (자바를 중심으로) 졸리운_곰 2021.01.29 96
988 한글 도깨비 5.1 소프트웨어 버전 file 졸리운_곰 2021.01.26 194
987 아래아 한글 2.1 일반용 file 졸리운_곰 2021.01.26 85
986 아래아 한글 1.51 file 졸리운_곰 2021.01.26 95
985 NEMESIS Go Master 3.2 (바둑) file 졸리운_곰 2021.01.26 73
984 미니 한글 라이브러리 file 졸리운_곰 2021.01.26 121
983 한글 인코딩의 이해 2편: 유니코드와 Java를 이용한 한글 처리 file 졸리운_곰 2021.01.26 112
982 한글 인코딩의 이해 1편: 한글 인코딩의 역사와 유니코드 졸리운_곰 2021.01.26 86
981 한글 인코딩의 이해(유니코드) 완전 기초! file 졸리운_곰 2021.01.26 147
980 Quick Basic 4.5 file 졸리운_곰 2021.01.25 71
979 컴퓨터 속의 한글 도서 부록 디스켓 file 졸리운_곰 2021.01.25 75
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED