Virtual hosts don't work. I don't know what to do


#1

Hey I tried to set-up virtual hosts my first time.
DOMAIN REDIRECT TO LOCALHOST WEBSITE. (webware.pl) I want to redirect it to var/www/e2hc.pl not to var/www
I read a lot of tutorials, but i still can’t do this. Now I think i can’t setup because virtual host have problem with SSL.
I have debian 7.
I have enabled site e2hc.pl by command a2ensite e2hc.pl and I didnt get any errors.
Please, help thanks!
That’s my virtual host for domain which redirect to directory var/www/e2hc.pl


Problem with virtual host
#2

Oh I have copy and paste it from default directory, but there wasnt ServerName and Server alias so i added this.


#3

I believe your issue doesn’t belong here. It should be posted in an Apache server forum (or Stack Overflow?).


#4

I said, In my opinion I did everything well, and i’m able to think that’s cause cloudflare SSL, and I hope there will be a guy who can help me if im wrong and that’s not cause cloudflare :confused:


#5

Well, but the website for me works and it’s HTTPS…

You are asking redirects to local folders, in the config file for Apache.


#6

Once you get your virtual host settings in Apache fixed, you’ll be able to use SSL from Cloudflare.


#7

Guys, I have SSL already. Yes I was asking redirect to local folders, but if there is a other way to do it you can help me Matteo.


#8

Ok, so you want a redirect. You can also use Page Rules to redirect to a folder in your domain.


#9

Eem no.
I want to setup 2 sites on one ip.


#10

That’s an Apache configuration issue, not a Cloudflare issue. Please refer to @matteo’s Stack Overflow suggestion above.

Once you get those two domains (or sites) working on one IP address, you’ll be able to add them to Cloudflare.


#11

I posted on Stack Overflow. Matteo, if u have some time, can you look and help me with solution? Thanks.


#12

I really don’t know my way around Apache config so well, basic config it’s fine, but nothing too advanced in that department. Hope you find a solution though!

May I suggest you try creating two VirtualHost blocks, though? May work, nginx works that way…


#13

This is as old as Apache itself:


#14

Good to know, my idea was correct even though I never used it :joy:


#15

You are using IIS? :joy:


#16

Usually nginx, Node.js/Express or preferably something that need no configuration for those things (Firebase, their CDN is faster than CF’s even if in cache given same POP location, it’s Google, but still).


#17

Thanks god. For a minute i thought you’re a Windows guy :speak_no_evil: :smiling_imp:


#18

Never! I have it in a VM just in case I need to help somebody using it or for specific use cases where UNIX/macOS doesn’t work. We’re getting off-topic… Would love PMs for TL4, @Ryan.

EDIT: actually never even used or installed IIS once.


#19

I did that and still redirecting to main site(webware.pl)
I tried to put it into default file, and next i created new file e2hc.pl and there I put this.
And I don’t understand whats mean NameVirtualHost *:80
Help please :confused:


#20

This is error in putty, when I put NameVirtualHost *:80
cloudflare4
what thats meaning?