我有一個運行Elastic Beanstalk的EC2實例。我想啓用GZIP壓縮,並且我知道我需要修改我的.htaccess
文件。AWS EC2上的.htaccess在哪裏EB
我讀過.htaccess
文件位於應用程序安裝的根文件夾中。但是,我似乎無法找到它。 (我是新手,不知道根文件夾在哪裏)。
我能夠通過Java 8應用程序ssh登錄運行Apache Tomcat 8的服務器。
問題
凡位於.htaccess
?
這是我在我的根:
$ ls
bin cgroup etc lib local media opt root sbin srv tmp var
boot dev home lib64 lost+found mnt proc run selinux sys usr
UPDATE
我有一個.ebextensions/tomcat-settings.config
現在的作品。它啓用GZip壓縮。
option_settings:
aws:elasticbeanstalk:environment:proxy:
GzipCompression: 'true'
ProxyServer: nginx
aws:elasticbeanstalk:environment:proxy:staticfiles:
/pub: public
雖然這似乎並不壓縮.svg
文件。所以,如果有可能,我想有以下,但不知道在哪裏添加:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
我對豆莖不熟悉,但嘗試添加-a開關到ls,因爲.htaccess是一個隱藏文件。 ls -a允許您查看所有文件,包括隱藏的文件。 –