1

Topic: I can't create another website on the server on iRedmail

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version :1.6.3
- Deployed with iRedMail Easy or the downloadable installer?: downloadable
- Linux/BSD distribution name and version: Ubuntu22.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? :No
====

Excuse me.
I want to host roundcube on mail.example.com and another site on example.com, but I can't.
Configure Nginx as shown below, restart, and even if you access example.com, it will be redirected to RoundCube.
How can I host another site without redirects?


```
server {
    listen 80;
    listen [::]:80;

    server_name example.com;

    root /var/www/example.com;
    index index.html index.php;

    location / {
        try_files $uri $uri/ =404;
    }
}

server {
        listen 443;
        listen [::]:443;

        root /var/www/example.com;
        index index.html index.html index.php;

        server_name example.com;

        location / {
                try_files $uri $uri/ =404;
        }
}
```

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: I can't create another website on the server on iRedmail

I could not do it even if I referred to the following page.
How can I add another website?
ttps://dev.bdhostit.com/1951/iredmail-nginx-adding-website-to-home-server/

3

Re: I can't create another website on the server on iRedmail

knife-karasawa wrote:

I could not do it even if I referred to the following page.
How can I add another website?
ttps://dev.bdhostit.com/1951/iredmail-nginx-adding-website-to-home-server/

Just create another server{...} like so

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name mail.example.com;

    root /opt/www/roundcubemail;
    index index.php index.html index.htm;

    include /etc/nginx/templates/roundcube-subdomain.tmpl;
}

You might need to place this one ABOVE the other https servers.

4

Re: I can't create another website on the server on iRedmail

The configuration file was missing the .conf extension.
I apologize to you for a fuss over.

5 (edited by bewo 2023-07-30 06:02:56)

Re: I can't create another website on the server on iRedmail

knife-karasawa wrote:

The configuration file was missing the .conf extension.
I apologize to you for a fuss over.

Hi, I have the same problem. Can you help me out? I understand that you have solved the problem and I would be grateful if you could help me. If possible how should new server be added in .conf. For example: if ttps://mail.test.com is the mail, how to set up the site ttps://test.com. Thank you in advance!

6

Re: I can't create another website on the server on iRedmail

Hi,
I am trying to add a Wordpress site to the iRedMail server, and can't get it to work.  I have tried the following config file suggested by Nginx:

# Upstream to abstract backend connection(s) for php
upstream php {
        server unix:/tmp/php-cgi.socket;
        server 127.0.0.1:9000;
}

server {
        ## Your website name goes here.
        server_name domain.tld;
        ## Your only path reference.
        root /var/www/wordpress;
        ## This should be in your http block and if it is, it's not needed here.
        index index.php;

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location / {
                # This is cool because no php is touched for static content.
                # include the "?$args" part so non-default permalinks doesn't break when using query string
                try_files $uri $uri/ /index.php?$args;
        }

        location ~ \.php$ {
                #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                include fastcgi_params;
                fastcgi_intercept_errors on;
                fastcgi_pass php;
                #The following parameter can be also included in fastcgi_params file
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
        }
}

https://www.nginx.com/resources/wiki/st … wordpress/

Can you help?

7

Re: I can't create another website on the server on iRedmail

I fixed it.  The problem was the upstream php url was not 127.0.0.1:9000 it was 127.0.0.1:9999 on Debian 12.