Cognitionis
The little I know

Web developing


Apache PHP MySQL, the fantastic three.

Apache Basic Kit

PHP Basic Kit

MySQL Basic Kit

DRUPAL Basic Kit

Configuring Linux for web developing (Apache, php , Mysql and NetBeans)

Never use online-web-IDEs to work (like WordPress admin panel). Try Ubuntu->Places->Connect2Server (make bookmark), it works like in local.

To see how a web page is seen in other web browsers try netrender online tool.

To see how a web page performs speed/memory recomendations use http://www.websiteoptimization.com/services/analyze/.

For translations, multilinguality, laguages use gettext (php-gettext packet) standard using software: gtranslator.

Colors are important use: colorlovers.com, colorotate.org, colorschemedesigner.com

For make profesional editable <textareas> use TinyMCE. (updated recently wijwij)

Forum, Forums: PhpBB

Javascript: To make powerful things try jQuery: validate (form validation), tools (nice effects), cycle (for images), cufon (fonts).

Firefox tools:

Firebug (sudo apt-get install firebug) (html, css, javascript… DEBUGING)

Webdeveloper (xhtml, css… VALIDATION)

Integrated solutions:

Blog, Blogs, Blogging, CMS: WordPress

CMS: Ver drupal

Web Analysis, Google positioning and other search engines

Analysis: google analytics is the best

Google positioning (Google Webmaster Tools): Create an account in google webmaster tools. In html head, put good keywords, good site description and good web content. Create a standard sitemap (sitemap.xml) using a standart tool (sitemap_gen.py) and upload it in your google account. Links to your site an from your site are very important for pagerank algorithm try webrank plugin. Read google webmaster guidelines.

Google MAPS:

(1) Put you bussiness in Google Local Bussines Center.

(2) Put an embedded google map into your site (location/contact page). To do so go to your google account search the location in your google maps (my maps option), put an indication mark over the place, and then copy the iframe embedding code by clicking in the link button (at top right part of the map). Then paste it into your web page and that’s it!

Other search engines: Register your site in Yahoo, and Microsoft.

WordPress as a CMS

useful plugins: wp-cache,  wpml(MULTILANG), more fields (MORE BLOGS (TYPES)/PAGE TYPES). users – role manager (USERS). images->wp-slimbox2, last updated footer

To make a CMS you may like to create a wp theme into a folder by changing the basic pages (index.php, head.php, header.php, page.php, footer.php, etc.). You must also change default blog start page by a home static page (settings).

To create a customized homepage define home.php in your theme. If you want homepage to be indexed, and considered as  a regular page, make a page, make as initial page in settings and define a special template to diferentiate it from others.

Fully WP export (online/offline copy)

  1. Instead of use import/export functions builtin wp-interface, copy the whole wpfolder into server and also export all the tables of the wp-database.
  2. DB: Import sql tables. Edit the wp-options table of database and replace all field value that contains references to localhost with the real online domain.
  3. FOLDER FILES: Edit wp-config.php and change db connection and other server dependent settings to the online ones.
  4. Remember that to enable permalinks we must include a .htaccess file that looks like:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

  1. Thats it!!

PLUGINS PARA HACER GALERIA EASY: Use the WP integrated gallery (uploading images).

To separate the blog from cms create a empty blog page and put permalinks as /blog/%year%/…

.

Per a pagines especials crear templates(plantilles) nous, es pot incloure header i tot igual i usar bd…

codex.wordpress.org

After installed Apache, PHP and MySQL.

  1. sudo a2enmod rewrite
  2. Fitxer wijwij en /etc/apache2/sites-avaliable
    NameVirtualHost *
    <VirtualHost *>
    ServerName wijwij.local

    DocumentRoot /home/hector/Dropbox/Projects/wijwij.com/netbeans-project/wijwij/web/html/
    <Directory
    /home/hector/Dropbox/Projects/wijwij.com/netbeans-project/wijwij/web/html/>
    Options FollowSymLinks
    AllowOverride All
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
    ServerSignature On

    </VirtualHost>

  3. sudo a2ensite nom (activa el nou lloc web creat)
  4. sudo /etc/init.d/apache2 reload
  5. sudo vim /etc/hosts (editar el domini i afegir lo blau) (127.0.0.1 localhost wijwij.local)
  6. sudo /etc/init.d/apache2 restart
  7. phpmyadmin -> per defecte no funciona, hi ha que fer un enllaç simbolic sudo ln -s (sudo ln -s /usr/share/phpmyadmin/ /var/www/)
  8. En mysql setpassword pq tampoc funciona per defecte (a partir de intrepid si)

Tools you need: HTML/PHP Editor: Try to find one with autocompletion and debbug options (i.e. NetBeans PHP). TestBankBrowser: Firefox+Firebug

Create a WordPress local copy:

1. Export MySQL DB
2. Copy web folder files
3. Import DB in local MySQL
4. Create user in local MySQL
5. Modify wp-options table rows 1 and 40 with local server information
6. Modify wp-config.php with local DB information
7. Activate in httpd.conf (Apache config file) the rewrite module.
* LoadModule rewrite_module modules/mod_rewrite.so
8. Change in httpd.conf: AllowOverride All.

TIP: If permalinks doesn’t work properly switch them to ?p=xxx