Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Multiple websites, static, and with database #143

Open
migandhi opened this issue Jul 25, 2024 · 4 comments
Open

[Feature] Multiple websites, static, and with database #143

migandhi opened this issue Jul 25, 2024 · 4 comments

Comments

@migandhi
Copy link

Hi,
Greetings,

I want inputs about the following:

`Also be your web server - if you want:

Static sites? No problem!
Front-end + back-end? No problem!
PHP? Did I stutter? We got you!
How many sites can I host at the same time? How many you want (provided your server can handle all of them, of course)

`

Is there any management tool for this, a web based UI to do all this?
Without disturbing the existing setup

Regards.

@ddavness
Copy link
Owner

Right now this "support" is less about actively supporting hosting websites alongside with your email as a first-party feature, rather it is modified to be less intrusive and get less in your way (allowing you to use the tools you're most comfortable with). However, you'll still need to fiddle and play with nginx configurations (which is something I'm not sure I documented very well tbh, need to work on this later when I have time).

Or in a nutshell: if you install postgresql/mysql on the box, it will not be "touched" by the management daemon (There is one exception: Apache, since it conflicts with Nginx directly).

You'll still need to install all the tools manually, but as long as you can proxy them via Nginx (it offers a reverse proxy feature), it shouldn't be an issue (the box will then be able to automatically provision the SSL certificates for those sites if you choose to make them public)

Let me know if you have any other questions! 😄

@lifeboy
Copy link

lifeboy commented Aug 12, 2024

Have look at the folder /home/user-data/www/ on your server. In there is a conf file for every domain generated on your PMaiB server. By adding a single line into one of the .conf file your can include a web service located somewhere else on your box for each domain.

For example, in myboxdomain.co.za.conf you'll see:

# Custom configurations for myboxdomain.co.za go here
# To use php: use the "php-fpm" alias

index index.html index.htm;

If you add a reverse proxy config in there, you don't have to worry about PMiaB updates breaking your web servers. I think that gives you and idea of how it can be done. You may even be able to install something like webmin, as long as you avoid the ports that PMiaB is using and then reverse proxy those sites via these .conf files.

@migandhi
Copy link
Author

Hi,
Thanks for you reply,
@lifeboy

I currently have requirement for multiple static websites only,
But I want my VPS to serve multiple purpose.
I have a client customer. I already installed this "power mail in a box"
on Ubuntu 20.04

I got enough hint from your response.

When I will add another domain to use with mail box
which generates DNS records automatically
and like you said it will create conf file

Which I can edit and redirect to my webpage.

Although it is too much technical for me
But I appreciate your response

Thanks,
Regards.

@lifeboy
Copy link

lifeboy commented Aug 13, 2024

When I will add another domain to use with mail box which generates DNS records automatically and like you said it will create conf file

Which I can edit and redirect to my webpage.

Although it is too much technical for me But I appreciate your response

The way to learn how this works is by trying it out. Create your website somehow. Then try to add a line to point Nginx to the webserver. Suppose you install wordpress and run it on port 81 instead the default port 80. You would then add something like this to the .conf file for the domain PMiaB has configured for you:

location / {
    proxy_pass http://127.0.0.1:81;
#    proxy_set_header Host $http_host;
#    proxy_set_header X-Real-IP $remote_addr;
#    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#    proxy_set_header X-Forwarded-Proto $scheme;

Try it to see if you can get it going.

PS. If you install Wordpress and you need a config for nginx, then add the important lines into the .conf file. (Don't put the server { directive in, since that's already in the PMiaB config. Only add the location parts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants