Created
March 6, 2012 08:57
-
-
Save and1truong/1985019 to your computer and use it in GitHub Desktop.
Drupal Course @ trum.co
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Print workding directory | |
| pwd | |
| # Change working directory | |
| cd /var/www/training.drupal.local | |
| # Change working directory, and remember current working directory | |
| pushd /var/www/training.drupal.local | |
| # Go back to last remembered directory (see pushd) | |
| popd | |
| # List directory items | |
| ls | |
| ls -l | |
| ls -la | |
| # Make directory | |
| mkdir /path/to/new-dirname | |
| mkdir -p /path/to/new1/new2/new3 | |
| # Remove a file | |
| rm /path/to/filename | |
| # Remove a directory | |
| rm -rf /path/to/directory-name | |
| # Create new file | |
| touch /path/to/newfile.txt | |
| # Copy file, directory | |
| cp /path/to/file1 /path/to/file2 | |
| cp -rf /path/to/director1 /path/to/directory2 | |
| # Move/Rename file/directory | |
| mv /path/to/old-file-location /path/to/new-file-location | |
| mv /path/to/old-directory-location /path/to/new-directory-location | |
| # View a file | |
| cat /path/to/file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| api = 2 | |
| core = 7.x | |
| projects[drupal][version] = 7 | |
| ; Dependencies ================================================================= | |
| projects[addressfield][type] = module | |
| projects[addressfield][subdir] = contrib | |
| projects[addressfield][version] = 1.x-dev | |
| projects[addressfield][download][type] = git | |
| projects[addressfield][download][url] = http://git.drupal.org/project/addressfield.git | |
| projects[addressfield][download][branch] = 7.x-1.x | |
| projects[ctools][type] = module | |
| projects[ctools][subdir] = contrib | |
| projects[ctools][version] = 1.x-dev | |
| projects[ctools][download][type] = git | |
| projects[ctools][download][url] = http://git.drupal.org/project/ctools.git | |
| projects[ctools][download][branch] = 7.x-1.x | |
| projects[entity][type] = module | |
| projects[entity][subdir] = contrib | |
| projects[entity][version] = 1.x-dev | |
| projects[entity][download][type] = git | |
| projects[entity][download][url] = http://git.drupal.org/project/entity.git | |
| projects[entity][download][branch] = 7.x-1.x | |
| projects[rules][type] = module | |
| projects[rules][subdir] = contrib | |
| projects[rules][version] = 2.x-dev | |
| projects[rules][download][type] = git | |
| projects[rules][download][url] = http://git.drupal.org/project/rules.git | |
| projects[rules][download][branch] = 7.x-2.x | |
| projects[views][type] = module | |
| projects[views][subdir] = contrib | |
| projects[views][version] = 3.x-dev | |
| projects[views][download][type] = git | |
| projects[views][download][url] = http://git.drupal.org/project/views.git | |
| projects[views][download][branch] = 7.x-3.x | |
| ; Drupal Commerce and Commerce contribs ======================================== | |
| projects[commerce][type] = module | |
| projects[commerce][subdir] = contrib | |
| projects[commerce][version] = 1.x-dev | |
| projects[commerce][download][type] = git | |
| projects[commerce][download][url] = http://git.drupal.org/project/commerce.git | |
| projects[commerce][download][branch] = 7.x-1.x | |
| projects[commerce_authnet][type] = module | |
| projects[commerce_authnet][subdir] = contrib | |
| projects[commerce_authnet][version] = 1.x-dev | |
| projects[commerce_authnet][download][type] = git | |
| projects[commerce_authnet][download][url] = http://git.drupal.org/project/commerce_authnet.git | |
| projects[commerce_authnet][download][branch] = 7.x-1.x | |
| projects[commerce_paypal][type] = module | |
| projects[commerce_paypal][subdir] = contrib | |
| projects[commerce_paypal][version] = 1.x-dev | |
| projects[commerce_paypal][download][type] = git | |
| projects[commerce_paypal][download][url] = http://git.drupal.org/project/commerce_paypal.git | |
| projects[commerce_paypal][download][branch] = 7.x-1.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| core = 6.x | |
| api = 2 | |
| projects[drupal][version] = 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| core = 7.x | |
| api = 2 | |
| projects[drupal][version] = 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 192.168.56.115 drupal.local chive.drupal.local training.drupal.local | |
| 221.132.36.8 drupalcode.org ftp.drupal.org | |
| # Server hosts file: /etc/hosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| core = 7.x | |
| api = 2 | |
| projects[drupal][type] = core | |
| projects[drupal][version] = "7.12" | |
| projects[martplug][type] = profile | |
| projects[martplug][download][type] = git | |
| projects[martplug][download][url] = http://git.drupal.org/project/martplug.git | |
| projects[martplug][download][branch] = 7.x-1.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Connect | |
| mysql -u root -proot -h localhost | |
| Exit | |
| ctrl+c | |
| quit; | |
| Show database | |
| SHOW DATABASES; | |
| Create new user: | |
| CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'drupalpass'; | |
| Create new database: | |
| CREATE DATABASE drupal_training | |
| Grant user to database | |
| GRANT ALL PRIVILEGES ON *.* TO 'drupal'@'%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| core = "6.x" | |
| api = "2" | |
| projects[drupal][version] = 6 | |
| ; Contrib projects | |
| projects[admin][subdir] = "contrib" | |
| projects[admin][version] = "2.0" | |
| projects[boxes][subdir] = "contrib" | |
| projects[boxes][version] = "1.0" | |
| projects[casetracker][subdir] = "contrib" | |
| projects[casetracker][version] = "1.0-beta9" | |
| projects[cck][subdir] = "contrib" | |
| projects[cck][version] = "2.9" | |
| projects[codefilter][subdir] = "contrib" | |
| projects[codefilter][version] = "1.0" | |
| projects[comment_upload][subdir] = "contrib" | |
| projects[comment_upload][version] = "1.0-alpha5" | |
| projects[content_profile][subdir] = "contrib" | |
| projects[content_profile][version] = "1.0" | |
| projects[context][subdir] = "contrib" | |
| projects[context][version] = "3.0" | |
| projects[crayon][subdir] = "contrib" | |
| projects[crayon][version] = "1.0-beta3" | |
| projects[ctools][subdir] = "contrib" | |
| projects[ctools][version] = "1.8" | |
| projects[date][subdir] = "contrib" | |
| projects[date][version] = "2.8" | |
| projects[designkit][subdir] = "contrib" | |
| projects[designkit][version] = "1.0-beta1" | |
| projects[diff][subdir] = "contrib" | |
| projects[diff][version] = "2.3" | |
| projects[features][subdir] = "contrib" | |
| projects[features][version = "1.1" | |
| projects[feeds][subdir] = "contrib" | |
| projects[feeds][version] = "1.0-beta11" | |
| projects[data][subdir] = "contrib" | |
| projects[data][version] = "1.0" | |
| projects[imageapi][subdir] = "contrib" | |
| projects[imageapi][version] = "1.10" | |
| projects[imagecache][subdir] = "contrib" | |
| projects[imagecache][version] = "2.0-beta12" | |
| projects[imagecache_profiles][subdir] = "contrib" | |
| projects[imagecache_profiles][version] = "1.3" | |
| projects[itweak_upload][subdir] = "contrib" | |
| projects[itweak_upload][version] = "2.5" | |
| projects[job_scheduler][subdir] = "contrib" | |
| projects[job_scheduler][version] = "1.0-beta3" | |
| projects[jquery_ui][subdir] = "contrib" | |
| projects[jquery_ui][version] = "1.5" | |
| projects[jquery_update][subdir] = "contrib" | |
| projects[jquery_update][version] = "2.0-alpha1" | |
| projects[libraries][subdir] = "contrib" | |
| projects[libraries][version] = "1.0" | |
| projects[litecal][subdir] = "contrib" | |
| projects[litecal][version] = "1.0" | |
| projects[mailcomment][subdir] = "contrib" | |
| projects[mailcomment][version] = "1.0" | |
| projects[mailhandler][subdir] = "contrib" | |
| projects[mailhandler][version] = "1.11" | |
| projects[markdown][subdir] = "contrib" | |
| projects[markdown][version] = "1.2" | |
| projects[messaging][subdir] = "contrib" | |
| projects[messaging][version] = "2.4" | |
| projects[nodeformcols][subdir] = "contrib" | |
| projects[nodeformcols][version] = "1.6" | |
| projects[notifications][subdir] = "contrib" | |
| projects[notifications][version] = "2.3" | |
| projects[notifications][patch][] = "https://raw.github.com/gist/1444791/77e3bc869fe8fab2b78f782c28799e662a959dad/plain_check--notification-6.x-2.3.patch" | |
| projects[notifications_team][subdir] = "contrib" | |
| projects[notifications_team][version] = "2.1-beta8" | |
| projects[og][subdir] = "contrib" | |
| projects[og][version] = "2.2" | |
| projects[openidadmin][subdir] = "contrib" | |
| projects[openidadmin][version] = "1.2" | |
| projects[parser_ical][subdir] = "contrib" | |
| projects[parser_ical][version] = "2.0-beta1" | |
| projects[prepopulate][subdir] = "contrib" | |
| projects[prepopulate][version] = "2.2" | |
| projects[purl][subdir] = "contrib" | |
| projects[purl][version] = "1.0-beta13" | |
| projects[reldate][subdir] = "contrib" | |
| projects[reldate][version] = "1.0-beta2" | |
| projects[spaces][subdir] = "contrib" | |
| projects[spaces][version = "3.2" | |
| projects[strongarm][subdir] = "contrib" | |
| projects[strongarm][version] = "2.1" | |
| projects[token][subdir] = "contrib" | |
| projects[token][version] = "1.18" | |
| projects[transliteration][subdir] = "contrib" | |
| projects[transliteration][version] = "3.0" | |
| projects[ucreate][subdir] = "contrib" | |
| projects[ucreate][version] = "1.0-beta4" | |
| projects[views][subdir] = "contrib" | |
| projects[views][type] = "module" | |
| projects[views][version] = "2.16" | |
| ; http://drupal.org/node/694094 | |
| projects[views][patch][] = "http://drupal.org/files/issues/views-static-cache-resets-694094-7.patch" | |
| ; original issue: http://drupal.org/node/357529 | |
| projects[views][patch][] = "http://cloud.github.com/downloads/developmentseed/atrium_features/views2_simple_translatables.patch" | |
| ; http://drupal.org/node/789674#comment-3230930 | |
| projects[views][patch][] = "http://drupal.org/files/789674-29-vocabulary_module-6.x-2.x.patch" | |
| ; fix views SQL missing alias | |
| projects[views][patch][] = "https://raw.github.com/gist/1434459/99c827d0500acd78c2e428a72eb1d29d642d1a2a/views-2.16-1040744.patch" | |
| projects[xref][subdir] = "contrib" | |
| projects[xref][version] = "1.0" | |
| ; Development modules | |
| projects[coder][subdir] = "developer" | |
| projects[coder][version] = "2.0-rc1" | |
| projects[devel][subdir] = "developer" | |
| projects[devel][version] = "1.26" | |
| projects[schema][subdir] = "developer" | |
| projects[schema][version] = "1.7" | |
| projects[simpletest][subdir] = "developer" | |
| projects[simpletest][version] = "2.11" | |
| ; Features | |
| projects[atrium_features][type] = "module" | |
| projects[atrium_features][download][type] = "git" | |
| projects[atrium_features][download][url] = "http://github.com/phase2/atrium_features.git" | |
| projects[atrium_features][download][tag] = "6.x-1.2" | |
| ; l10n | |
| projects[l10n_client][subdir] = "l10n" | |
| projects[l10n_client][version] = "2.0" | |
| projects[l10n_update][subdir] = "l10n" | |
| projects[l10n_update][location] = "http://featureserver.phase2technology.com/fserver" | |
| projects[l10n_update][version] = "1.0-alpha1" | |
| ; Themes | |
| projects[tao][version] = "3.2" | |
| projects[rubik][version] = "3.0-beta2" | |
| projects[ginkgo][type] = "theme" | |
| projects[ginkgo][download][type] = "git" | |
| projects[ginkgo][download][url] = "http://github.com/phase2/ginkgo.git" | |
| projects[ginkgo][download][tag] = "6.x-1.1" | |
| ; Libraries | |
| libraries[jquery_ui][download][type] = "get" | |
| libraries[jquery_ui][download][url] = "http://jquery-ui.googlecode.com/files/jquery-ui-1.7.3.zip" | |
| libraries[jquery_ui][directory_name] = "jquery.ui" | |
| libraries[jquery_ui][destination] = "modules/contrib/jquery_ui" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Nginx: | |
| service nginx start | |
| service nginx stop | |
| service nginx restart | |
| // Start nginx | |
| nginx | |
| // Stop nginx | |
| nginx -s stop | |
| // Test nginx configuration | |
| nginx -t | |
| // Reload | |
| nginx -s reload | |
| PHP{5.2,5.3}-FPM: | |
| PHP 5.2: listen port 9000 | |
| PHP 5.3: listen port 9090 | |
| service php-fpm start | |
| service php53-fpm start | |
| service php-fpm stop | |
| service php53-fpm stop | |
| service php-fpm restart | |
| service php53-fpm restart | |
| MySQL: | |
| service mysql start | |
| service mysql stop | |
| service mysql restart | |
| OS: | |
| Restart: | |
| reboot | |
| Shutdown: | |
| poweroff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| server_name training.drupal.local; | |
| listen 192.168.56.115:80; | |
| root /var/www/training.drupal.local; | |
| location = /favicon.ico { | |
| log_not_found off; | |
| access_log off; | |
| } | |
| location = /robots.txt { | |
| allow all; | |
| log_not_found off; | |
| access_log off; | |
| } | |
| # This matters if you use drush | |
| location = /backup { | |
| deny all; | |
| } | |
| # Very rarely should these ever be accessed outside of your lan | |
| location ~* \.(txt|log)$ { | |
| allow 192.168.0.0/16; | |
| deny all; | |
| } | |
| location ~ \..*/.*\.php$ { | |
| return 403; | |
| } | |
| location / { | |
| # This is cool because no php is touched for static content | |
| try_files $uri @rewrite; | |
| } | |
| location @rewrite { | |
| # Some modules enforce no slash (/) at the end of the URL | |
| # Else this rewrite block wouldn't be needed (GlobalRedirect) | |
| rewrite ^/(.*)$ /index.php?q=$1; | |
| } | |
| location ~ \.php$ { | |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
| #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini | |
| include fastcgi_params; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| fastcgi_intercept_errors on; | |
| fastcgi_pass 127.0.0.1:9000; | |
| } | |
| # Fighting with ImageCache? This little gem is amazing. | |
| location ~ ^/sites/.*/files/imagecache/ { | |
| try_files $uri @rewrite; | |
| } | |
| # Catch image styles for D7 too. | |
| location ~ ^/sites/.*/files/styles/ { | |
| try_files $uri @rewrite; | |
| } | |
| location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | |
| expires max; | |
| log_not_found off; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment