Dose caddy can add php_admin_value like open_basedir on windows?


(wedds) #1

i want to run caddy as a windows web server,but dont know how to set caddy safety.
so i got these questions:

  1. can caddy can run as servise using a guests account on windows?
  2. how to add php_admin_value on every vhost?
    really thank you.

(Toby Allen) #2

Hi

You can try it out and see what happens. SEt up your guest account and run caddy. Use a differnt port and Caddy wont interfere with any other webserver you have running

example.com:12345 {
    root c:\www
    fast-cgi etc.....
}

You will then be able to test your site on port 12345 http://example.com:12345

What is php_admin_value?


(wedds) #3

thank you for reply my post,although i know how to set up an site using caddy.
in windows/apache ,to set diffrient site more safety,first we create an guest account to run apache as services,then add php_admin_value open_basedir “D:\wwwroot\abc.com\www;C:\WINDOWS\temp” , to make sure when site was attacked by hackers,they cannot attack other virtual host.

an sample apache vhost.conf:
<VirtualHost *:80>
<Directory “D:\wwwroot\abc\www”>
Options -Indexes

ServerAdmin abc@email.com
DocumentRoot “D:\wwwroot\abc\www”
ServerName abc.com
ServerAlias www.abc.com
DirectoryIndex index.html index.php index.htm
#using this tag to limit the php basedir
php_admin_value open_basedir “D:\wwwroot\abc\www;C:\WINDOWS\TEMP”


(Matthew Fay) #4

Hi @wedd, Caddy doesn’t run PHP as a module. The server instead typically relies on its FastCGI directive, which doesn’t provide a mechanism for overriding .htaccess or php.ini settings.

The full capability of the FastCGI directive is documented here: https://caddyserver.com/docs/fastcgi