Skip to content

Instantly share code, notes, and snippets.

@linkarys
Last active December 15, 2015 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linkarys/5279285 to your computer and use it in GitHub Desktop.
Save linkarys/5279285 to your computer and use it in GitHub Desktop.
ubuntu: apache-settings
apache:{
1. syntax test: sudo apachectl configtest / sudo apachectl -t
2. restart: sudo apachectl restart
3. dis/enable site sudo a2[dis | en] site [SITENAME]
4. httpd.conf: ServerName 127.0.1.1
5. hosts: 127.0.0.1 PC_NAME
6. dropbox: ./dropbox-list/dropbox
7. cfusion10: /opt/coldfusion10/cfusion/bin/coldfusion start
8. unzip tar.bz2: tar -jxvf FileName.tar.bz2
9. unzip .tar.gz: tar -zxvf FileName.tat.gz
10. mysqlli undifined: sudo apt-get install php5-mysql
8. ssi{
1. sudo ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled
2.{
/* test: ubuntu 12.04 */
<VirtualHost *:80>
ServerName www.degle.net
ServerAlias degle.net cmbnet.com
ServerAdmin linkary@hotmail.com
DocumentRoot /home/linkary/文档/www/cmb
<Directory /home/linkary/文档/www/cmb>
Options Indexes FollowSymLinks MultiViews
|------ AddHandler server-parsed .html
| AllowOverride None
| Order allow,deny
| allow from all
| </Directory>
|
| ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
| <Directory "/usr/lib/cgi-bin">
| AllowOverride None
| Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
| Order allow,deny
| Allow from all
| </Directory>
|
| ErrorLog /home/linkary/文档/www/cmb/logs/error.log
|
| # Possible values include: debug, info, notice, warn, error, crit,
| # alert, emerg.
| LogLevel warn
|
| CustomLog /home/linkary/文档/www/cmb/logs/access.log combined
|
| Alias /doc/ "/usr/share/doc/"
| <Directory "/usr/share/doc/">
| Options Indexes MultiViews FollowSymLinks
| AllowOverride None
| Order deny,allow
| Deny from all
| Allow from 127.0.0.0/255.0.0.0 ::1/128
| </Directory>
|
| </VirtualHost>
|
| /* test: win7 */
|------ NameVirtualHost *:80
| <VirtualHost *:80>
| ServerName www.depache.net
| ServerAlias depache.net
| ServerAdmin linkary@hotmail.com
| DocumentRoot V:/Dropbox/www/apache
| <Directory V:/Dropbox/www/>
| Options Indexes FollowSymLinks MultiViews Includes
| IndexOptions HTMLTable FoldersFirst SuppressRules XHTML FancyIndexing IgnoreCase
| AddOutputFilter INCLUDES .html
|------ #AddHandler server-parsed .html
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog V:/Dropbox/www/logs/apache-error.log
CustomLog V:/Dropbox/www/logs/apache-access.log combined
</VirtualHost>
},
9. # ADD STYLES {
Alias /lib "V:/Dropbox/www/lib"
IndexStyleSheet "/lib/style.css"
AddIcon (CAT,/lib/back.png) ..
AddIcon (CAT,/lib/txt.png) .txt
AddIcon (CAT,/lib/ini.png) .ini
AddIcon (CAT,/lib/zip.png) .zip
AddIcon (CAT,/lib/cfm.png) .cfm
AddIcon (CAT,/lib/jar.png) .jar
AddIcon (CAT,/lib/xml.png) .xml
AddIcon (CAT,/lib/css.png) .css
AddIcon (CAT,/lib/log.png) .log
AddIcon (CAT,/lib/js.png) .js
AddIcon (CAT,/lib/html.png) .html
AddIcon (CAT,/lib/ico.png) .ico
AddIcon (CAT,/lib/image.png) .jpg .gif .png .jepg .bmp
AddIcon (DIR,/lib/folder.png) ^^DIRECTORY^^
DefaultIcon "/lib/file.png"
# ERROR PROCESS
ErrorDocument 404 /lib/errors/no-found.html
ErrorDocument 403 /lib/errors/forbidden.html
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment