Noggin01
Posts: 61
Joined: Tue Jan 07, 2014 1:38 pm

RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 11:03 am

I had two web sites, both were Wordpress based sites and both were hosted with a webhost that just suddenly turned off their service (little more to it than that, but honestly it doesn't matter to this question.) Both of my sites were very low traffic, one is used basically as a way for my wife to announce pregnancy updates to family and the other is just a hobby for me. My home internet service is 50/5, and I THINK will be upgraded to 300/30 within a year. I think it should be sufficient for hosting my two piddly sites. My router handles a dynamic DNS service.

Since I have two websites I want to run, I'll need to configure website1.com to go to myipaddress:80 and website2.com to go to myipaddress:81. Can Apache be configured to host two web pages on separate port numbers? Can Wordpress be configured to host two separate web pages on different ports? Or do I need to install two instances of Apache / Wordpress on a Pi? Or, should I just buy two Pi's?

User avatar
joan
Posts: 14074
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 11:26 am

The web servers allow you to run multiple sites on one machine. My public sites run on a machine with hundreds if not thousands of other sites. All using port 80.

You probably want to Google something like apache virtual hosting.

forenbenutzer
Posts: 148
Joined: Thu Aug 02, 2012 7:08 pm

Re: RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 11:34 am

It's as easy as that:

https://www.digitalocean.com/community/ ... -12-04-lts

All on port 80, of course, but in different directories.

Edit: Sorry, link was in german.
Pitendo - Case And Emulator Project - http://edv-huber.com/index.php/problemloesungen/12-pitendo

Richdotward
Posts: 17
Joined: Fri Mar 08, 2013 6:35 pm

Re: RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 12:35 pm

I do something similar but wanted to keep things as simple as possible.

2 sites on 1 server just stored in different directors. Registered 2 free mooo.com names then on the main index.HTML page at root I did :

<html>
<head>
<script language="javascript">


var href = document.location.href;

if (href.indexOf("somewhere.mooo.com") > 0)
document.location.href ="http://somewhere.mooo.com/directory1"
else
document.location.href ="http://somewhere.mooo.com/directory2"


</script>
</head>
</html>

Entering somewhere.mooo.com goes to directory1 anything else to directory2.

Simple but works

Noggin01
Posts: 61
Joined: Tue Jan 07, 2014 1:38 pm

Re: RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 1:25 pm

Sweet! Thanks everyone!

And Wordpress is happy having two different, unrelated sites, with different themes as well? Man, it will be so nice to do this. Last host had a 2 MByte upload file size restriction and my wife wants to post a ton of 2.5 to 3 MByte videos. Getting something that worked well and easy for her was a pain. Being able to post bigger files will be so much nicer.

plugwash
Forum Moderator
Forum Moderator
Posts: 3433
Joined: Wed Dec 28, 2011 11:45 pm

Re: RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 3:20 pm

Richdotward wrote:I do something similar but wanted to keep things as simple as possible.

2 sites on 1 server just stored in different directors. Registered 2 free mooo.com names then on the main index.HTML page at root I did :

<html>
<head>
<script language="javascript">


var href = document.location.href;

if (href.indexOf("somewhere.mooo.com") > 0)
document.location.href ="http://somewhere.mooo.com/directory1"
else
document.location.href ="http://somewhere.mooo.com/directory2"


</script>
</head>
</html>

Entering somewhere.mooo.com goes to directory1 anything else to directory2.

Simple but works
Why oh why do people come up with such horrible hacks when doing it properly is so easy

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

Re: RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 4:34 pm

I'd definitely go with the virtual host solution.

Note that you will need to use a page caching plugin to run 2 Wordpress sites on one Pi, and you'll probably need to look into tuning MySQL.
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

1clue
Posts: 21
Joined: Thu Jul 17, 2014 11:29 pm

Re: RaspberryPi, Two Domain Names, Two Wordpress Sites?

Fri Jul 18, 2014 5:12 pm

If your wordpress is its own web server, then I'd still use apache2 with name-based virtual hosts as a front end. You can have as many sites as you want and have apache proxy the transactions as necessary by the name typed into the browser.

It looks like two different web sites, you don't need anything different in your html or anything.

This is how it's done, and as was mentioned earlier it's easier than what you were trying.

Return to “General discussion”