mod_allowmethods to get all the http methods working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I'm developing a REST api based on PHP 7.1 and Apache 2.4 (under ubuntu 17.10). The api requires the following methods working:

GET POST OPTIONS PUT DELETE

After a lot of googling and asking to other colleagues I finally arrived at mod_allowmethods so I changed my configuration in the following way:

<VirtualHost *:80>
    ServerName myserver.org
    ServerAlias be.myserver.org

    ServerAdmin xxx@xxxxxx
    DocumentRoot /var/www/be.myserver.org/

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

    DocumentRoot /var/www/be.myserver.org/

    <Location "/">
        AllowMethods OPTIONS GET POST PUT DELETE
    </Location>

    ServerSignature Off
</VirtualHost>

Of course I enabled the mod_allowmethods:

# apache2ctl -M
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 allowmethods_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php7_module (shared)
 reqtimeout_module (shared)
 setenvif_module (shared)
 status_module (shared)

I included the list of all enabled modules just to be sure there are no other modules conflicting.

Thanks everybody for help! I'm sure that someone that is an Apache guru can help me solve this nasty question!

Francesco



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux