Web Panel



  • Hello,
    I added a new directory in /srv/pufferpanel but I can't acces it on the browser. What can I do?

    server {
    listen 80;
    root /srv/pufferpanel/;
    index index.php;
    
    server_name hosting.andrei1058.com;
    
    client_max_body_size 20m;
    client_body_timeout 120s;
    
    location / {
        try_files /public/router.php =404;
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index router.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
    }
    
    location /assets {
        try_files /app/$uri =404;
        }
    }
    ######
    


  • can anyone help me?



  • No problem for me to visit the page o.o

    Look at this screenshot:

    alt text



  • Because we use a router, it's not possible to just create a directory in /srv/pufferpanel and be able to access it. PufferPanel would have to know about it. Instead, you can create another location block in the nginx configuration.

    This example assumes the directory is located at /srv/pufferpanel/exampledirectory

    server {
      listen 80;
      root /srv/pufferpanel/;
      index index.php;
    
      server_name hosting.andrei1058.com;
    
      client_max_body_size 20m;
      client_body_timeout 120s;
    
      location / {
          try_files /public/router.php =404;
          fastcgi_split_path_info ^(.+?\.php)(/.*)$;
          fastcgi_pass 127.0.0.1:9000;
          fastcgi_index router.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include /etc/nginx/fastcgi_params;
      }
    
      location /assets {
        try_files /app/$uri =404;
      }
    
      location /exampledirectory {
      }
    }
    

    This works because we already have the root set to /srv/pufferpanel for that server block. If the directory you wish to expose is outside of /srv/pufferpanel you can add a root to it like this. This example assumes the directory is located at /var/www/exampledirectory

    location /exampledirectory {
        root /var/www/;
    }
    

    Finally, if you would like the directory name to be different than what is shown in the URL, for example you have files at /var/www/aquarium/seahorses and would like it to be accessible at yourdomain.com/fish, you can use an alias.

    location /fish {
        alias /var/www/aquarium/seahorses;
    }
    

    Hope this helps.



  • when I go to http://website.com/test it download a file called download :|



  • Is it a PHP or HTML file that you are trying to serve? If you are trying to serve PHP you'll need to pass it to PHP-FPM. Remember to change the fastcgi_pass to what your system uses. You should be able to find it at the top of the pufferpanel.conf file.

    location  /aquarium {
        alias /var/www/fishapp;
        location ~ \.php$ {
              fastcgi_split_path_info ^(.+\.php)(/.+)$;
              #fastcgi_pass 127.0.0.1:9000;
              fastcgi_pass unix:/var/run/php5-fpm.sock;
              fastcgi_index index.php;
              include fastcgi_params;
        }
    }
    


  • @puffrfish
    thanks but now it gives me a blank screen :c
    edit: solved. thanks for help :D


Log in to reply
 

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