Use project outside www folder as subhost.


  • | 1395 points

    I have a project that are in other folder, outside C:/laragon/www. There is a way to use it as a subhost in laragon ?

    Project Location: C:/Users/Wemerson/Dropbox/Dev/blog.


  • administrators
    | 97623 points

    @wemersonrv : You can copy a virtual host file in Menu > Apache > sites-enabled then rename the ServerName and DocumentRoot. You also need to remove the auto. prefix so Laragon will not update the file.


  • | 1395 points

    @leokhoa said in Use project outside www folder as subhost.:

    @wemersonrv : You can copy a virtual host file in Menu > Apache > sites-enabled then rename the ServerName and DocumentRoot. You also need to remove the auto. prefix so Laragon will not update the file.

    Let's see if i understood: So i need go to Menu > Apaxe(or nginx) > sites-enabled > dir:sites-enabled and here clone any .conf file and manually change the appointments from c:/laragon/www/SITE... to my new folder right?! Here i understand so far.

    So, in nginx, there are the SSL certificates and keys too and in this case i don't know how to do with .cert and .key files... Can i clone any other file and use it in other site ? Or the files will be generated later?

    server {
        listen 80;
        listen 443 ssl;
        server_name teste1.home *.teste1.home; # 1 - Here i put the website domains
        root "C:/laragon/www/teste1/public/";  # 2 - Here i put the website public root folder
        
        index index.html index.htm index.php;
     
        location / {
            try_files $uri $uri/ /index.php$is_args$args;
    		autoindex on;
        }
        
        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass php_upstream;		
            #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }
    
        # Enable SSL
        ssl_certificate "C:/laragon/etc/ssl/teste1.home.crt"; # 3 - Here I don't know how to do
        ssl_certificate_key "C:/laragon/etc/ssl/teste1.home.key"; # 4 - Here too i don't know
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
        ssl_prefer_server_ciphers on;
    	
    	
        charset utf-8;
    	
        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }
        location ~ /\.ht {
            deny all;
        }
    }
    

  • administrators
    | 97623 points

    @wemersonrv : What is your Laragon's version?
    Look like you are using a very old version of Laragon. Thing is a little bit complicated if you use SSL.


  • | 1395 points

    @leokhoa said in Use project outside www folder as subhost.:

    @wemersonrv : What is your Laragon's version?
    Look like you are using a very old version of Laragon. Thing is a little bit complicated if you use SSL.

    Nope.. this is a version i get in Laragon Download page: v3.2.3. This version:

    https://forum.laragon.org/topic/755/laragon-3-2-released-php-7-2-0-vc15-apache-to-2-4-29-vc15-node-js-8-9-1-yarn-1-3-2-composer-1-5-3


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.