Web Site and OC on the same server - it's possible?

Hi Everyone
Is it possible to configure VHost in such a way that the purchased domain (for example domainOne.pl) after entering into the browser displayed the page on my Apache2 + server after entering the IpServer / owncloud browser to get to the cloud?

I am asking for help in configuring VHost. I tried in different ways but to no avail or both vhosts work in mode:
IpSerwera / domainOne.pl
IpSerwera / ownCloud

or

domainOne.pl - works
IpServera / owncloud - does not work

my Vhosts:
                <VirtualHost *:80>

                    ServerAdmin     gielas.g@lgmail.com
                    DocumentRoot    /var/www/html/owncloud
                    ServerName      owncloud
                    ServerAlias     owncloud

                    <Directory /var/www/html/owncloud>
                            AllowOverride All
                            Order allow,deny
                            Allow from all
                            DirectoryIndex /var/www/html/owncloud
                            Options FollowSymlinks
                            SetEnv HOME             /var/www/html/owncloud
                            SetEnv HTTP_HOME        /var/www/html/owncloud

                    </Directory>

                    ErrorLog ${APACHE_LOG_DIR}/error.log
                    CustomLog ${APACHE_LOG_DIR}/access.log combined
         </VirtualHost>

    vhost domain:
        <VirtualHost *:80>
                ServerAdmin     gielas.g@gmail.com
                DocumentRoot    /var/www/html/ciesliska.pl
                ServerName      www.ciesliska.pl
                ServerAlias     ciesliska.pl
                CustomLog       /var/www/logs/ciesliska.log combined
                ErrorLog        /var/www/logs/ciesliska.log
                <Directory /var/www/html/ciesliska.pl>
                        AllowOverride All
                        Order allow,deny
                        Allow from all
                        DirectoryIndex /var/www/html/ciesliska.pl
                        Options FollowSymlinks
                </Directory>


        </VirtualHost>

Thanks Very Much

@mysterIIyx

how doese your trusted domain in config.php looks like?

Hi. My config.php:
‘trusted_domains’ =>
array (
0 => ‘31.186.198.150’,
1 => ‘192.168.1.104’,
2 => ‘192.168.1.102’,
3 => ‘192.168.0.103’,

when I type:
http://31.186.198.150/owncloud/

response firefox is:
The requested URL /owncloud/index.php was not found on this server.

vhost is for something like this:
http://owncloud.domain.com/

if you want to use it like this:
http://31.186.198.150/owncloud
you should have this configuration:

> cd /etc/apache2/conf-available
>  cat owncloud.conf                                                                                                    
    Alias /owncloud "/var/www/owncloud/"                                                                                                                                
    Header always set Strict-Transport-Security "max-age=15552000"                                                                                                      
                                                                                                                                                                            
        <Directory /var/www/owncloud/>                                                                                                                                      
            Options +FollowSymlinks                                                                                                                                         
            AllowOverride All                                                                                                                                               
                                                                                                                                                                            
            <IfModule mod_dav.c>                                                                                                                                            
                 Dav Off                                                                                                                                                    
            </IfModule>                                                                                                                                                     
                                                                                                                                                                            
            SetEnv HOME /var/www/owncloud                                                                                                                                   
            SetEnv HTTP_HOME /var/www/owncloud                                                                                                                              
                                                                                                                                                                            
        </Directory>                                                                                                                                                        
        <FilesMatch ".+\.phps$">                                                                                                                                            
            # Deny access to raw php sources by default                                                                                                                     
            # To re-enable it's recommended to enable access to the files                                                                                                   
            # only in specific virtual host or directory                                                                                                                    
            Require all denied                                                                                                                                              
        </FilesMatch>                                                                                                                                                       
        # Deny access to files without filename (e.g. '.php')                                                                                                               
        <FilesMatch "^\.ph(p[3457]?|t|tml|ps)$">                                                                                                                            
            Require all denied                                                                                                                                              
        </FilesMatch>                     

 > cd /etc/apache2/conf-enable/
 > ln -sf ../conf-available/owncloud.conf owncloud.conf

but it will be available also with http://domain.com/owncloud, if the domain.com is not added into your config.php at trusted domain you will not be able to sign in.
If you don’t want at all to access it with http://domain.com/owncloud then you should play with:

RewriteEngine                                                                                                                                                       
RewriteCond                                                                                                                                               
RewriteRule

I want to use:

  1. ciesliska.pl

  2. 31.186.198.150/owncloud/

Replace ServerName owncloud with ServerName ciesliska.pl
and
comment out ServerAlias owncloud by writing # at the beginning of the line.

ServerName ciesliska.pl
#ServerAlias owncloud

add ciesliska.pl to your trusted domains in config.php

and restart apache service.

> sudo systemctl restart apache2.service

I make subdomain like sub.ciesliska.pl. I’m waiting for propagation and we will see what happens :slight_smile:

is your domain with static IP or dynamic?

I have static IP. Made new domain xxx.ciesliska.pl and correctly conf vhost on my server and all app really perfect work.

In mobile app ownCloud on the fisrt minute of the life domain when I typing name of the the domain the app give me an error “the local copy name can not be changed”, but few hours later everything was work corectly - I think that was depent on domain propagation.

Thanks Everyone For Help Me