Skip to main content

· One min read
Tien

Các kiểu được drupal 8 hỗ trợ: string, integer, map, filter_format, float, uri, boolean, datetime_computed, datetime_iso8601, any, language_reference, entity_reference, email, language.

· One min read
Tien

Same as drupal 7, we put this into sites/default/settings.php:

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

· One min read
Tien

Notice: Undefined index: path in Drupal\Core\Routing\RouteBuilder->rebuild() (line 97 of core/lib/Drupal/Core/Routing/RouteBuilder.php

Cách fix: trong file routing.yml, thay pattern bằng path.

· One min read
Tien
  1. Install dev build: http://www.sublimetext.com/3dev
  2. cd ~/.config/sublime-text-3/Packages
  3. git clone git://github.com/wbond/sublime_package_control.git Package\ Control
  4. git clone https://github.com/martomo/SublimeTextXdebug.git "Xdebug Client"
  5. git clone -b BH2ST3 git://github.com/facelessuser/BracketHighlighter.git "BracketHighlighter"
  6. git clone https://github.com/spadgos/sublime-jsdocs
  7. git clone -b st3 git://github.com/titoBouzout/SideBarEnhancements.git "SideBarEnhancements"
  8. git clone https://github.com/sergeche/emmet-sublime.git Emmet
  9. git clone https://github.com/bgreenlee/sublime-github
  10. wget https://github.com/SublimeCodeIntel/SublimeCodeIntel/archive/v2.0.6+st3.tar.gz tar xfvz v2.0.6+st3.tar.gz -C ./ mv SublimeCodeIntel-2.0.6-st3 SublimeCodeIntel
  11. git clone https://github.com/dzhibas/SublimePrettyJson.git
  12. git clone https://github.com/srusskih/SublimeJEDI.git SublimeJEDI
  13. git clone https://github.com/akalongman/sublimetext-codeformatter
sudo pear install PHP_Beautifier-0.1.15 --alldeps
sudo vim /usr/bin/php_beautifier
# line 52
# error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);

Refs: http://www.henriquebarroso.com/my-top-10sublime-2-plugins/

· One min read
Tien
  1. mv /.bashrc.bak.123456-789 .bashrc
  2. rm -rf abc/
update-alternatives --install "/usr/bin/drush" "drush" "/var/aegir/drush/drush" 2
update-alternatives --install "/usr/bin/drush" "drush" "/var/aegir/drush6/drush" 1
update-alternatives --config drush

· One min read
Tien
  1. ssh vào aegir.com
cd platforms
wget http://ftp.drupal.org/files/projects/drupal-6.28.tar.gz
wget http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz
tar xfvz drupal\*.tar.gz
  1. để truy cập vào site ta mới tạo reset username và pass thành admin và admin sau khi tạo mới site.

· 2 min read
Tien
  1. Cài debian 6, lúc cài chọn root pass là root, thêm user name là aegir và password là aegir: adduser --system --group --home /var/aegir aegir passwd aegir usermod -a -G www-data aegir

  2. Cài Aegir server. a. wget http://files.aegir.cc/versions/BARRACUDA.sh.txt b. sau khi tải về ta thay đổi thông số của file BARRACUDA.sh.txt _MY_OWNIP="192.168.56.101" _MY_HOSTN="aegir.com" _MY_FRONT="master.aegir.com" _EASY_HOSTNAME="debian.com" _AUTOPILOT=YES _MY_EMAIL="webdev@aegir.com" _DNS_SETUP_TEST=NO nếu có gặp lỗi dns thì nano /root/.barracuda.cnf _DNS_SETUP_TEST=NO c. nano /etc/hosts 192.168.56.101   aegir.com 192.168.56.101   master.aegir.com d. nano /etc/network/interface auto eth1 iface eth1 inet static address 192.168.56.101 network 192.168.56.0 netmask 255.255.255.0 # gateway 192.168.56.1 3. bạn nên thêm vào file /etc/hosts 2 dòng ở client: 192.168.56.101 aegir.com 192.168.56.101 master.aegir.com để client có thể truy cập vào admin.aegir.com để thay đổi pass và thực hiện cấu hình. ps: để đăng nhập và đổi pass ta làm như sau: cd ~ cat install.log dòng cuối cùng có chứa thông tin đăng nhập 1 lần để thay mật khẩu. hay có thể cd vào ~/host_master/001/sites/master.aegir drush uli để thay pass

  3. Sau khi cài xong, aegir cho ta một đường dẫn để reset password (nếu lỡ mất thì ta dùng lệnh drush uli). ta truy cập vào đường dẫn này từ 1 browser, reset username và pass lại thành admin và admin

  4. chsh -s /bin/bash aegir passwd aegir su aegir ssh-keygen nano /etc/hosts 192.168.56.102 web.com 192.168.56.103 database.com

  5. thêm webserver và database server. ssh-copy-id aegir@web.com ssh-copy-id root@web.com (rsync) ssh-copy-id aegir@database.com

nguồn http://friendlydrupal.com/screencasts/installing-barracuda-aegir

· 2 min read
Tien

ở đây có nói chi tiết về cách tạo web server cho aegir.http://community.aegirproject.org/node/396

  1. Chỉnh lại ip của web.com thành 192.168.56.102

  2. passwd aegir

  3. apt-get install sudo

  4. Cài debian7 chọn hostname là web, username và pass là webdev

  5. cài phần mêm trên web server (như ở trên)

  6. nên chọn bash thay cho sh vì bash tốt hơn nhiều (cụ thể là cho xem user hiện tại, directory hiện tại, host hiện tại và có thể auto complete.)

  7. không nên chạy dòng này ln -s /var/aegir/config/apache.conf /etc/apache2/conf.d/aegir.conf nếu chạy rồi thì xóa /etc/apache2/conf.d/aegir.conf đi

  8. dòng add key của debian.com nên thay bằng scp, thay

cat > /var/aegir/.ssh/authorized_keys <<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB...UF aegir@filer01
EOF

bằng

scp /var/aegir/.ssh/id_rsa.pub aegir@web.com:~/.ssh/authorized_keys

hay

ssh-copy-id aegir@web.com
  1. nếu thấy lỗi Could not rsync from '/var/aegir/...' to 'aegir@web.com:/ thì ở aegir.com ta đăng nhập vào aegir user, dùng lệnh ssh-copy-id aegir@web.com
  2. ở web server không tạo được platforms
  3. ln -s /var/aegir/config/apache.conf /etc/apache2/conf.d/aegir.conf service apache2 restart -Tim
wget http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
tar xfvz drush\*.tar.gz
ln -s drush/drush /usr/bin/drush
cd platforms/drupal7/sites/all/modules
drush/drush dl ...
cd platforms/drupal7/sites/examples.com
~/drush/drush en ... -y
  1. nano /etc/apache2/httpd.conf ServerName localhost

nguồn:

· One min read
Tien
  1. Cài debian 7 trong khi cài bạn chọn hostname là database có username là webdev và pass là webdev

  2. cài xong khởi động lại bạn cài phần mềm mysql server: apt-get install mysql-server  php5-mysql trong lúc cài bạn chọn pass cho user root là root

  3. cấu hình

  • cho phép remote access ở database đi vào command line của mysql
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO aegir@aegir.com IDENTIFIED BY 'aegir' WITH GRANT OPTION;
FLUSH PRIVILEGES;
  • edit file my.cnf sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak comment dòng bind-address = 127.0.0.1 _sudo /etc/init.d/mysql restart
  • lúc tạo database server, bạn nhập vào username và pass là aegir (vì aegir từ aegir.com đã được full quyền trên database.com)_

tham khảo http://www.ghacks.net/2009/12/27/allow-remote-connections-to-your-mysql-server/