Hi,
It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to write another blog post. So, here I am.
My 6.5 server have Let's Encrypt certificate which I have multiple subdomains in it. This OpenBSD system have Nginx which act as a HTTPS reverse proxy to Docker host backend.
[Router] <--https--> [OpenBSD] <--http--> [Docker]--http-->--https-->
For this example I'm replacing the subdomains with generic names. First, I check my existing SSL certificate.
$ doas certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
Certificate Name: domain.my
Domains: domain.my www.domain.my 123.domain.my 456.domain.my
Expiry Date: 2019-12-11 09:35:47+00:00 (VALID: 34 days)
Certificate Path: /etc/letsencrypt/live/domain.my/fullchain.pem
Private Key Path: /etc/letsencrypt/live/domain.my/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Great. I still have a valid certificate. What I'm planning to do is to remove these subdomains:
1) 123.domain.my
2) 456.domain.my
Then add 2 new subdomains:
1) abc.domain.my
2) def.domain.my
As I'm using Nginx to serve the certificate, I stopped my Nginx, preparing for the certificate modification.
$ doas rcctl stop nginx
Then I proceed to request for certificate modification using certbot. Take note the value of the previous "Certificate Name" as it's needed to properly modify existing cert.
$ doas certbot certonly --cert-name domain.my -d domain.my,www.domain.my,abd.domain.my,def.domain.my
After I run the command, the prompt to select the option I can use to authenticate my server. For this one, I opted to spin up temporary standalone webserver (option 1)
Saving debug log to /var/log/letsencrypt/letsencrypt.log
How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Plugins selected: Authenticator standalone, Installer None
Next certbot is showing me the changes that will be made. I then choose "U" to update the cert.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You are updating certificate domain.my to include new domain(s):
+ abc.domain.my
+ def.domain.my
You are also removing previously included domain(s):
- 123.domain.my
- 456.domain.my
Did you intend to make this change?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(U)pdate cert/(C)ancel: u
Renewing an existing certificate
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/domain.my/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/domain.my/privkey.pem
Your cert will expire on 2020-02-04. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
And it's done! So easy. Take note that I did not use " --expand " on the command.
If you did not include " --cert-name CERT_NAME" in your command, certbot will create another certificate and you might get additional certificate name with "-0001". Such as "domain.my-0001" and you will end up with 2 separate certificate instead.
That's all. Until next post!
Ref: https://certbot.eff.org/docs/using.html#renewing-certificates
Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts
Wednesday, November 06, 2019
Wednesday, December 14, 2016
-c X200 amd64: New bind-key for cwm.
Hey,
Updated my -CURRENT today and found that my key bindings in cwm no longer working. Done a man cwmrc and found that binding has changed.
Previous ~/.cwmrc
=====
#bind key binding
bind 4-l lock
=====
Now:
=====
bind-key 4-l lock
=====
Working now like a charm. cwm rocks!
Updated my -CURRENT today and found that my key bindings in cwm no longer working. Done a man cwmrc and found that binding has changed.
Previous ~/.cwmrc
=====
#bind key binding
bind 4-l lock
=====
Now:
=====
bind-key 4-l lock
=====
Working now like a charm. cwm rocks!
Thursday, May 12, 2016
-c amd64 X200: Installation for Drupal 8.
Hi,
It's been quite some time. I'm busy with day's work. Ah and also my X200's battery just died. So it's immobile. It's just docked and that's it. Replacement battery or "new" thinkpad (I always buy used anyway.), I'm not sure. But not now.
Ok back to the latest project/test I'm going to do. Drupal 8 has been released, I know I'm a bit late, and it's an interesting update. So I really want to install it. Take note that I'm installing this, after I installed Drupal 7. So nearly all of the dependencies are already there. You might want to (re)visit my previous post on this at http://karlbsd.blogspot.my/2015/08/openbsd-58-c-amd64-httpd-postgresql.html.
Recap, this is httpd + Drupal 8 + PostgreSQL.
1) Download Drupal 8.
I head over to http://www.drupal.org and download the latest stable version 8.1.1 which is drupal-8.1.1.tar.gz.
2) Extract file and move to htdocs.
I tar the downloaded drupal-8.1.1.tar.gz and rename the directory to drupal8 while moving it to /var/www/htdocs.
$ tar zxvf drupal-8.1.1.tar.gz
$ mv drupal-8.1.1 /var/www/htdocs/drupal8
3) Prepare the local hostname.
This Drupal, like the previous version, will only be a local testing environment. I also have a few *.example.com sites here, a plain php site, some drupal 7 site so I need to have another local hostname. I'm choosing drupal.example.com as my Drupal 7 site will now have drupal7.example.com instead. For that, I edited 2 files, /etc/hosts and /etc/httpd.conf.
$ vi /etc/hosts
===== /etc/hosts starts =====
127.0.0.1 drupal.example.com
===== /etc/hosts ends =====
$ vi /etc/httpd.conf
===== /etc/httpd.conf starts =====
server "drupal.example.com" {
listen on $ext_addr port 80
directory {
index "index.php"
}
location "*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs/drupal8"
}
===== /etc/httpd.conf ends =====
4) Drupal 8 installation.
Now is the good stuff. After I restart (restarting httpd is also ok), I fire up my browser and type "drupal.example.org" and Drupal 8 installation page is displayed. Nice!.
At the Choose language page, I just choose the default English and click Save and continue.
Choose profile, I choose Standard and click Save and continue.
Verify requirements, I was shown a warning and 2 errors. I'll show what I've done to resolve the warning/errors.
In OpenBSD 5.8 and newer, and -Current, the opcache.so is readily available. It's just that it's not included in /etc/php-5.6.ini. So I edited /etc/php-5.6.ini. My changes is in bold.
For this one, it's just that I create a files directory inside /sites/default. Then I chown the directory to www:www.
It's been quite some time. I'm busy with day's work. Ah and also my X200's battery just died. So it's immobile. It's just docked and that's it. Replacement battery or "new" thinkpad (I always buy used anyway.), I'm not sure. But not now.
Ok back to the latest project/test I'm going to do. Drupal 8 has been released, I know I'm a bit late, and it's an interesting update. So I really want to install it. Take note that I'm installing this, after I installed Drupal 7. So nearly all of the dependencies are already there. You might want to (re)visit my previous post on this at http://karlbsd.blogspot.my/2015/08/openbsd-58-c-amd64-httpd-postgresql.html.
Recap, this is httpd + Drupal 8 + PostgreSQL.
1) Download Drupal 8.
I head over to http://www.drupal.org and download the latest stable version 8.1.1 which is drupal-8.1.1.tar.gz.
2) Extract file and move to htdocs.
I tar the downloaded drupal-8.1.1.tar.gz and rename the directory to drupal8 while moving it to /var/www/htdocs.
$ tar zxvf drupal-8.1.1.tar.gz
$ mv drupal-8.1.1 /var/www/htdocs/drupal8
3) Prepare the local hostname.
This Drupal, like the previous version, will only be a local testing environment. I also have a few *.example.com sites here, a plain php site, some drupal 7 site so I need to have another local hostname. I'm choosing drupal.example.com as my Drupal 7 site will now have drupal7.example.com instead. For that, I edited 2 files, /etc/hosts and /etc/httpd.conf.
$ vi /etc/hosts
===== /etc/hosts starts =====
127.0.0.1 drupal.example.com
===== /etc/hosts ends =====
$ vi /etc/httpd.conf
===== /etc/httpd.conf starts =====
server "drupal.example.com" {
listen on $ext_addr port 80
directory {
index "index.php"
}
location "*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs/drupal8"
}
===== /etc/httpd.conf ends =====
4) Drupal 8 installation.
Now is the good stuff. After I restart (restarting httpd is also ok), I fire up my browser and type "drupal.example.org" and Drupal 8 installation page is displayed. Nice!.
At the Choose language page, I just choose the default English and click Save and continue.
Choose profile, I choose Standard and click Save and continue.
Verify requirements, I was shown a warning and 2 errors. I'll show what I've done to resolve the warning/errors.
| PHP OPcode caching | Not enabled
PHP OPcode caching can improve your site's performance considerably. It ishighly recommended to haveOPcache installed on your server.
|
|---|
===== /etc/php-5.6.ini starts =====
* other sections skipped *
engine = On
* other sections skipped *
; zend.script_encoding =
; This is for Drupal 8
zend_extension=/usr/local/lib/php-5.6/modules/opcache.so
===== /etc/php-5.6.ini ends =====
And after restarting, the warning is gone.
| File system | Writable (public download method)
The directory sites/default/files does not exist. An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.
|
|---|
$ cd /var/www/htdocs/drupal8/sites/default
$ mkdir files
$ chown www:www files
| Settings file | The Settings file does not exist.
The Drupal installer requires that you create a ./sites/default/settings.php as part of the installation process. Copy the./sites/default/default.settings.php file to./sites/default/settings.php. More details about installing Drupal are available inINSTALL.txt.
|
|---|
This error is telling me that I haven't edited a settings.php file yet. So I need to copy the default.settings.php file to settings.php file.
$ cd /var/www/htdocs/drupal8/sites/default
$ cp default.settings.php settings.php
$ vi settings.php
===== settings.php starts =====
* other sections skipped *
/ **
* Database settings
* bla bla bla
*/
$database['default']['default'] = array(
'driver' => 'pgsql',
'database' => 'drupal',
'username' => 'drupal',
'password' => 'mypassword',
'host' => 'localhost',
'prefix' => '',
);
* other sections skipped *
===== settings.php ends =====
Take note that I have an existing Drupal 7 installation using the same database information. Exactly the same setting.
Then I click "try again" link at the bottom of the page.
Then the Database configuration page opens up.
I key in my Database password, then click Save and continue. Then I received an error stating that Drupal already been installed. Sheesh.
I dropped the previous drupal database in PostgreSQL, keeping the drupal username. Then I createdb a new drupal database. Please check your INSTALL.pgsql.txt file for details. Also I deleted the settings.php and copy default.settings.php to settings.php without changing anything. Just making sure the file is read/writable.
Then I restarted the Drupal installation again, and the installation went through.
On the configuration page, I just put the needed info and click Save and continue.
Drupal proceed to install. And after installing I can see the main page. Yeah!. Being amazed, I clicked on Content to start exploring and.. Error 404, Page not found. Ouch. Every other links gave the same error.
So I search the trusty-ol-internet, and found that this is related to Clean URL and mod_rewrite which unfortunately, users of OpenBSD's httpd can't use right now. Ouch. Again. I'm searching for anything relevant, maybe I'll try to disable the Clean URL thingy. But for now, I do know that Drupal 8 installation can go through. Later.
$ cd /var/www/htdocs/drupal8/sites/default
$ cp default.settings.php settings.php
$ vi settings.php
===== settings.php starts =====
* other sections skipped *
/ **
* Database settings
* bla bla bla
*/
$database['default']['default'] = array(
'driver' => 'pgsql',
'database' => 'drupal',
'username' => 'drupal',
'password' => 'mypassword',
'host' => 'localhost',
'prefix' => '',
);
* other sections skipped *
===== settings.php ends =====
Take note that I have an existing Drupal 7 installation using the same database information. Exactly the same setting.
Then I click "try again" link at the bottom of the page.
Then the Database configuration page opens up.
Database configuration
I key in my Database password, then click Save and continue. Then I received an error stating that Drupal already been installed. Sheesh.
I dropped the previous drupal database in PostgreSQL, keeping the drupal username. Then I createdb a new drupal database. Please check your INSTALL.pgsql.txt file for details. Also I deleted the settings.php and copy default.settings.php to settings.php without changing anything. Just making sure the file is read/writable.
Then I restarted the Drupal installation again, and the installation went through.
On the configuration page, I just put the needed info and click Save and continue.
Drupal proceed to install. And after installing I can see the main page. Yeah!. Being amazed, I clicked on Content to start exploring and.. Error 404, Page not found. Ouch. Every other links gave the same error.
So I search the trusty-ol-internet, and found that this is related to Clean URL and mod_rewrite which unfortunately, users of OpenBSD's httpd can't use right now. Ouch. Again. I'm searching for anything relevant, maybe I'll try to disable the Clean URL thingy. But for now, I do know that Drupal 8 installation can go through. Later.
Thursday, November 12, 2015
-C amd64 X200: Using xdimmer to dim the laptop monitor.
Hi,
Great news. I've been using this since I updated my snapshot a few days ago now. This is the utility that I've been waiting for!
xdimmer
http://openports.se/x11/xdimmer
"xdimmer is a small utility to automatically dim the screen when
no keyboard or mouse input has been detected in the configured
number of seconds, and brighten it once input is detected."
What a great battery saver! So, as I'm using ~/.xsession, I just add this line before the execution of my window manager (cwm, what else!):
xdimmer -t 360 &
So, after 360 seconds of keyboard/mouse inactivity, xdimmer will dim my laptop's monitor to the default percentage (which is 5 percent).
Thanks to the contributor! Later.
Great news. I've been using this since I updated my snapshot a few days ago now. This is the utility that I've been waiting for!
xdimmer
http://openports.se/x11/xdimmer
"xdimmer is a small utility to automatically dim the screen when
no keyboard or mouse input has been detected in the configured
number of seconds, and brighten it once input is detected."
What a great battery saver! So, as I'm using ~/.xsession, I just add this line before the execution of my window manager (cwm, what else!):
xdimmer -t 360 &
So, after 360 seconds of keyboard/mouse inactivity, xdimmer will dim my laptop's monitor to the default percentage (which is 5 percent).
Thanks to the contributor! Later.
Wednesday, September 30, 2015
5.8-C amd64 X200: Lock X after suspend.
Hi,
Got a good tips from OpenBSD.newbies mailing list. How to lock the machine after suspend. Ok, normally, if I didn't xlock my X session and put the machine under suspend mode (eg: close the lid), my session will be restored when the machine wakes. My session is exposed. So here's how to automatically lock the session when the machine goes into suspend mode.
1) Create a suspend file inside /etc/apm.
In my machine, there's no /etc/apm folder. So I need to create it first. Then create a suspend file inside it.
$ doas mkdir /etc/apm
$ doas vi /etc/apm/suspend
----- /etc/apm/suspend starts -----
#!/bin/sh
pkill -USR1 xidle
----- /etc/apm/suspend ends -----
Then I need to make this suspend executable.
$ doas chmod 744 /etc/apm/suspend
2) Get xidle running on start.
I edited my
.xsession file and add this text:
----- ~/.xsession starts -----
xidle &
----- ~/.xsession ends -----
Then I run the xidle program.
$ xidle &
So basically when I close my machine's lid, suspend will trigger xidle to lock the machine. Nice stuff.
Reference:
http://www.mail-archive.com/openbsd-newbies@sfobug.theapt.org/msg00043.html
Got a good tips from OpenBSD.newbies mailing list. How to lock the machine after suspend. Ok, normally, if I didn't xlock my X session and put the machine under suspend mode (eg: close the lid), my session will be restored when the machine wakes. My session is exposed. So here's how to automatically lock the session when the machine goes into suspend mode.
1) Create a suspend file inside /etc/apm.
In my machine, there's no /etc/apm folder. So I need to create it first. Then create a suspend file inside it.
$ doas mkdir /etc/apm
$ doas vi /etc/apm/suspend
----- /etc/apm/suspend starts -----
#!/bin/sh
pkill -USR1 xidle
----- /etc/apm/suspend ends -----
Then I need to make this suspend executable.
$ doas chmod 744 /etc/apm/suspend
2) Get xidle running on start.
I edited my
.xsession file and add this text:
----- ~/.xsession starts -----
xidle &
----- ~/.xsession ends -----
Then I run the xidle program.
$ xidle &
So basically when I close my machine's lid, suspend will trigger xidle to lock the machine. Nice stuff.
Reference:
http://www.mail-archive.com/openbsd-newbies@sfobug.theapt.org/msg00043.html
5.8-C amd64 X200: Bye sudo, hi doas.
Hey,
Done updating, rebuilding the userland and following the.. err.. "Following -current" guide, now to reboot.
$ sudo reboot
ksh: sudo: not found
Oh. Yeah. I forgot. sudo is old news. Now it's doas time.
man doas
man doas.conf
Now, after all the setups, all I have to do to reboot is:
$ doas reboot
http://www.tedunangst.com/flak/post/out-with-the-old-in-with-the-less
http://www.tedunangst.com/flak/post/doas
Now it's just a matter of learning new habit. Later.
Done updating, rebuilding the userland and following the.. err.. "Following -current" guide, now to reboot.
$ sudo reboot
ksh: sudo: not found
Oh. Yeah. I forgot. sudo is old news. Now it's doas time.
man doas
man doas.conf
Now, after all the setups, all I have to do to reboot is:
$ doas reboot
http://www.tedunangst.com/flak/post/out-with-the-old-in-with-the-less
http://www.tedunangst.com/flak/post/doas
Now it's just a matter of learning new habit. Later.
Saturday, September 26, 2015
5.8-C amd64 X200: Drupal 7 Multisite.
Hey,
Why multisite? I read quite a bit of discouragement about this topic. Well, this is a local installation and it is a development (or hope to be) machine so I will (or might) be doing multiple sites. Hence the need.
My reference will be this site:
https://www.drupal.org/documentation/install/multi-site
You might need to refer to my previous posts as I might not be duplicating what is unnecessary here.
1) Preparing the site.
My default drupal site is drupal.example.com. So, I think I want to create another site called drupal2.example.com. I create a folder inside Drupal's sites folder.
$ cd /var/www/htdocs/drupal7/sites/
$ sudo mkdir drupal2.example.com
Along with that, I need to create a files folder inside my new drupal2's folder.
$ sudo mkdir -pm 777 drupal2.example.com/files
The files will need to be fully writeable as installation will gave error or not able to write inside that folder.
Folder creation done, now to set up appropriate files. Inside sites folder, there a file named example.sites.php. For a single-site.. err.. site, no need to touch this file but as I'm trying to create a multisite.. err.. site now, I need to edit this file. First I need to copy this file as sites.php file.
$ sudo cp example.sites.php sites.php
Now to edit this, adding this text at the bottom (bolded):
----- sites.php starts -----
<?php
* text snipped *
$sites['drupal2.example.com'] = 'example.com';
?>
----- sites.php ends -----
Yeah you read it right, I also included the closing tag for php as there's none there. Then I need to copy default.settings.php and put it as settings.php inside drupal2.example.com folder.
$ sudo cp sites/default/default.settings.php sites/drupal2.example.com/settings.php
Now to edit this file. I need to find and edit the $databases = array () occurances and change it to this.
----- drupal2 settings.php starts -----
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal2',
'username' => 'drupal',
'password' => 'password',
'host' => 'localhost',
'port' => '',
'driver' => 'pgsql',
'prefix' => '',
),
),
);
----- drupal2 settings.php ends -----
Remember this. I'm using PostgreSQL. This file is to set up my currently-non-existant new drupal2.example.com site's database. This part of the setup is complete.
2) Set up the database.
The command for PostgreSQL is:
$ createdb -U drupal -E UTF8 drupal2
For clarification, refer to my previous post about Drupal 7's installation. Basically I'm creating a black database using the "drupal" username with UTF8 encoding (needed!) and the name of that database is "drupal2". Make sure that the previous settings.php is configured according to this informations.
3) Set up the (local) domain.
I edited the /etc/hosts file.
----- /etc/hosts starts -----
127.0.0.1 drupal2.example.com
----- /etc/hosts ends -----
There's also other entries inside that file but I'm just showing the changes.
4) Configure HTTPd.
I edited the /etc/httpd.conf and inserted these text.
----- /etc/httpd.conf starts -----
server "juadah.example.com" {
listen on $ext_addr port 80
directory {
index "index.php"
}
location "*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs/drupal7"
}
----- /etc/https.conf ends -----
This is just a basic configuration. This should be it. Now to install the new site. I open up my browser, and type the new URL drupal2.example.com.
PDOException: SQLSTATE[42P01]:
Wha..?. I received errors instead talking about some PDO stuff. Ouch. After searching for a while, I found the answer. Wrong URL. The correct one for installation is:
drupal2.example.com/install.php
Then the installation went through. I got 2 warning when installing. 1 is for the files directory not writeable (hence the steps above) and the other one is about the unicode issue, refer my previous post as I need to patch the Drupal installation again because, hey, I'm following -CURRENT. Later.
Why multisite? I read quite a bit of discouragement about this topic. Well, this is a local installation and it is a development (or hope to be) machine so I will (or might) be doing multiple sites. Hence the need.
My reference will be this site:
https://www.drupal.org/documentation/install/multi-site
You might need to refer to my previous posts as I might not be duplicating what is unnecessary here.
1) Preparing the site.
My default drupal site is drupal.example.com. So, I think I want to create another site called drupal2.example.com. I create a folder inside Drupal's sites folder.
$ cd /var/www/htdocs/drupal7/sites/
$ sudo mkdir drupal2.example.com
Along with that, I need to create a files folder inside my new drupal2's folder.
$ sudo mkdir -pm 777 drupal2.example.com/files
The files will need to be fully writeable as installation will gave error or not able to write inside that folder.
Folder creation done, now to set up appropriate files. Inside sites folder, there a file named example.sites.php. For a single-site.. err.. site, no need to touch this file but as I'm trying to create a multisite.. err.. site now, I need to edit this file. First I need to copy this file as sites.php file.
$ sudo cp example.sites.php sites.php
Now to edit this, adding this text at the bottom (bolded):
----- sites.php starts -----
<?php
* text snipped *
$sites['drupal2.example.com'] = 'example.com';
?>
----- sites.php ends -----
Yeah you read it right, I also included the closing tag for php as there's none there. Then I need to copy default.settings.php and put it as settings.php inside drupal2.example.com folder.
$ sudo cp sites/default/default.settings.php sites/drupal2.example.com/settings.php
Now to edit this file. I need to find and edit the $databases = array () occurances and change it to this.
----- drupal2 settings.php starts -----
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal2',
'username' => 'drupal',
'password' => 'password',
'host' => 'localhost',
'port' => '',
'driver' => 'pgsql',
'prefix' => '',
),
),
);
----- drupal2 settings.php ends -----
Remember this. I'm using PostgreSQL. This file is to set up my currently-non-existant new drupal2.example.com site's database. This part of the setup is complete.
2) Set up the database.
The command for PostgreSQL is:
$ createdb -U drupal -E UTF8 drupal2
For clarification, refer to my previous post about Drupal 7's installation. Basically I'm creating a black database using the "drupal" username with UTF8 encoding (needed!) and the name of that database is "drupal2". Make sure that the previous settings.php is configured according to this informations.
3) Set up the (local) domain.
I edited the /etc/hosts file.
----- /etc/hosts starts -----
127.0.0.1 drupal2.example.com
----- /etc/hosts ends -----
There's also other entries inside that file but I'm just showing the changes.
4) Configure HTTPd.
I edited the /etc/httpd.conf and inserted these text.
----- /etc/httpd.conf starts -----
server "juadah.example.com" {
listen on $ext_addr port 80
directory {
index "index.php"
}
location "*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs/drupal7"
}
----- /etc/https.conf ends -----
This is just a basic configuration. This should be it. Now to install the new site. I open up my browser, and type the new URL drupal2.example.com.
PDOException: SQLSTATE[42P01]:
Wha..?. I received errors instead talking about some PDO stuff. Ouch. After searching for a while, I found the answer. Wrong URL. The correct one for installation is:
drupal2.example.com/install.php
Then the installation went through. I got 2 warning when installing. 1 is for the files directory not writeable (hence the steps above) and the other one is about the unicode issue, refer my previous post as I need to patch the Drupal installation again because, hey, I'm following -CURRENT. Later.
Wednesday, September 02, 2015
5.8-S amd64 X200: httpd Virtual Host.
Hi,
I've been having headache trying to solve the Virtual Hosting issue when using OpenBSD's new httpd (starting from 5.7) included in the base. After fairly quite a lot a trial and errors (mostly errors) and nearly downloading nginx today, I finally got the Virtual Host working now.
I really like the concept of OpenBSD's new httpd. Simple configuration, the devs are keeping the code simple and it's in the base. I also got Drupal 7 working fine (except for clean url, which is minor as this is for developing, not production) and I'm having fun learning Drupal here. But so far, I only managed to get 1 site working at a time. That means, I need to reconfigure my /etc/httpd.conf every time I want to change the website I want to work on. If I only want to work on a single site, this would not pose a problem. But I have more than 1 website I want to work on, so this is tiring me down.
I know that the httpd is chrooted by default, but I didn't know how to configure it properly until now. Well "properly" is not as "perfect" but more to "got it to work" kind of saying. So please correct me if you find anything that's wrong here. So here it goes.
My scenario, I'm working in 1 Drupal 7 site, then 1 another html/php site. The directory is as below:
/var/www/htdocs (the /var/www is the chroot directory)
/var/www/htdocs/drupal7 (my drupal dev directory, the default as installed)
/var/www/htdocs/karl (my html/php dev site)
For Drupal 7 installations and configurations, you can check my previous post. Now here's my /etc/httpd.conf.
---- /etc/httpd.conf start ----
I've been having headache trying to solve the Virtual Hosting issue when using OpenBSD's new httpd (starting from 5.7) included in the base. After fairly quite a lot a trial and errors (mostly errors) and nearly downloading nginx today, I finally got the Virtual Host working now.
I really like the concept of OpenBSD's new httpd. Simple configuration, the devs are keeping the code simple and it's in the base. I also got Drupal 7 working fine (except for clean url, which is minor as this is for developing, not production) and I'm having fun learning Drupal here. But so far, I only managed to get 1 site working at a time. That means, I need to reconfigure my /etc/httpd.conf every time I want to change the website I want to work on. If I only want to work on a single site, this would not pose a problem. But I have more than 1 website I want to work on, so this is tiring me down.
I know that the httpd is chrooted by default, but I didn't know how to configure it properly until now. Well "properly" is not as "perfect" but more to "got it to work" kind of saying. So please correct me if you find anything that's wrong here. So here it goes.
My scenario, I'm working in 1 Drupal 7 site, then 1 another html/php site. The directory is as below:
/var/www/htdocs (the /var/www is the chroot directory)
/var/www/htdocs/drupal7 (my drupal dev directory, the default as installed)
/var/www/htdocs/karl (my html/php dev site)
For Drupal 7 installations and configurations, you can check my previous post. Now here's my /etc/httpd.conf.
---- /etc/httpd.conf start ----
# Macros
ext_addr="*"
# Server
server "default" {
listen on $ext_addr port 80
directory {
auto index
}
location "*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
location "/cgi-bin/*" {
fastcgi
root "/"
}
}---- /etc/httpd.conf end ----
Now that's for the default site. I noticed that if I change the upper part to:
server "www.example.com" {
listen on $ext_addr port 80
alias "example.com"Then if I just type "example.com" in my browser, it will display my local site's main page instead of the internet's site. Take note that it's easier to use "Private Window" (Firefox) or "Incognito Window" (Chrome) for testing purpose. I also set the index to be created automatically because I don't want to create any site inside the root "/htdocs" directory and this is just a local development machine. Now for the Virtual Host setting inside /etc/httpd.conf.
---- /etc/httpd.conf continues ----
# virtual server for Drupal
server "drupal.example.com" {
listen on $ext_addr port 80
directory {
index "index.php"
}
location "*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs/drupal7"
}
# virtual server for Karl
server "karl.example.com" {
listen on $ext_addr port 80
location "*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs/karl"
}
types {
includes "/usr/share/misc/mime.types"
}---- /etc/httpd.conf ends ----
Now this is the simplest working form of my /etc/httpd.conf. On httpd side, this should be ok. Now for the important part, making the Virtual Host part work. As httpd works in chroot by default, it will only access files inside /var/www for safety reason. So I need to create an etc directory inside /var/www.
# mkdir /var/www/etcThen I need to copy /etc/hosts and /etc/resolv.conf into /var/www/etcb.
# cp /etc/hosts /var/www/etc
# cp /etc/resolv.conf /var/www/etcThis is the content of both files:
---- /var/www/etc/hosts start ----
127.0.0.1 localhost www.example.com
::1 localhost www.example.com---- /var/www/etc/hosts end ----
---- /var/www/etc/resolv.conf start ----
# Generated by em0 dhclient
search Home
nameserver 127.0.0.1
lookup file bind---- /var/www/etc/resolv.conf end ----
Ok. I was thinking that to make Virtual Host using httpd works, I need to edit that /var/www/etc/hosts file, as that is the chroot directory. I was wrong. I didn't manage to get the Virtual Host working by editing that file. It was the /etc/hosts file that needs editing. Here's mine.
---- /etc/hosts start ----
127.0.0.1 localhost www.example.com
127.0.0.1 drupal.example.com
127.0.0.1 karl.example.com
::1 localhost www.example.com---- /etc/hosts end ----
I only use 2 Virtual Hosts as of now, but I'm guessing that more can be set up with appropriate configuration changes. So now I restarted the httpd.
# sudo /etc/rc.d/httpd restartOpen up my browser, typed all 3 urls:
www.example.com
drupal.example.com
karl.example.com
and all open up the appropriate pages. I'm loving this! Now this leave only 1 more minor thing to be done, the Clean URL. But like I've said, it's only a minor thing. Later.
Friday, August 07, 2015
SNAPSHOT amd64 X200: httpd + PostgreSQL + Drupal 7.
Hey,
Starting with 5.7, OpenBSD have their own httpd replacing nginx in base. This httpd is fairly new and un/fortunately I'm trying to learn Drupal nowadays. Sure I can install Apache or nginx from port but I want to test the new httpd.
Take note!
1) I'm currently on -CURRENT using snapshot.
2) I never installed drupal or any web app before.
3) This is a Work In Progress and will be updated until it's done.
So I guess that's quite a warning for you guys. My installation might not be the correct one or might not even install correctly but I will try to make sure I find out how to make this work. Googling for info on the new httpd with Drupal only return less than handful of info. But as always, web searching is needed. So without any delays, here I go.
SETTING UP HTTPD.
As I'm going Openbsd's own (and new) httpd, the program has been already installed. To enable it, I just need to edit /etc/httpd.conf. I commented all the entries in that file except for this few lines (mostly the "A minimal default server" entries).
---- /etc/httpd.conf start ----
# Macros
ext_addr="*"
# A minimal default server
server "default" {
listen on $ext_addr port 80
location "*.php" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs"
}
# Include MIME types instead of the built-in ones
types {
include "/usr/share/misc/mime.types"
}
---- /etc/httpd.conf end ----Starting with 5.7, OpenBSD have their own httpd replacing nginx in base. This httpd is fairly new and un/fortunately I'm trying to learn Drupal nowadays. Sure I can install Apache or nginx from port but I want to test the new httpd.
Take note!
1) I'm currently on -CURRENT using snapshot.
2) I never installed drupal or any web app before.
So I guess that's quite a warning for you guys. My installation might not be the correct one or might not even install correctly but I will try to make sure I find out how to make this work. Googling for info on the new httpd with Drupal only return less than handful of info. But as always, web searching is needed. So without any delays, here I go.
SETTING UP HTTPD.
As I'm going Openbsd's own (and new) httpd, the program has been already installed. To enable it, I just need to edit /etc/httpd.conf. I commented all the entries in that file except for this few lines (mostly the "A minimal default server" entries).
---- /etc/httpd.conf start ----
# Macros
ext_addr="*"
# A minimal default server
server "default" {
listen on $ext_addr port 80
location "*.php" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs"
}
# Include MIME types instead of the built-in ones
types {
include "/usr/share/misc/mime.types"
}
As a simple rule-of-a-thumb, start with the minimum configuration then adjust from there. It's easier to check for error/mistakes. As Drupal is a PHP program, I need to install PHP. I also will be using PostgreSQL for the database. What I've installed is:
php-5.6.11
php-fpm.5.6.11p0
php-gd-5.6.11 (this might be dependency, I can't recall right now)
php-pdo_pgsql-5.6.11 (I'll be using PostgreSQL instead of MySQL)
postgresql-client-9.4.4
postgresql-contrib-9.4.4
postgresql-docs-9.4.4 (optional, but I want it)
postgresql-server-9.4.4
As we can see in the /etc/httpd.conf, there's "php-fpm" entry. As the package has been installed, I need to make it start at boot along with httpd by editing /etc/rc.conf.local.
---- /etc/rc.conf.local start ----
httpd_flags=
slowcgi=
pkg_scripts=php_fpm postgresql
---- /etc/rc.conf.local end ----
The "slowcgi" came with httpd, so I add it in /etc/rc.conf.local. Now we can either start httpd, slowcgi & php-fpm manually now or reboot. Unlike Apache, there's no template webpage that you can see after your httpd has started. So I created a Hello World-like index.html file inside the webserver's root directory which is /var/www/htdocs/. So now I open up my web browser and insert the URL as either "localhost" or "127.0.0.1" (without quotes), I can see the Hello World page. Httpd is running fine. To test the PHP function, I created a phpinfo.php file inside the same directory with this value:
---- /var/www/htdocs/phpinfo.php start ----
<?php phpinfo(); ?>
---- /var/www/htdocs/phpinfo.php end ----
I open the URL "localhost/phpinfo.php" in my browser, the PHP Version page is displayed and I know PHP is working fine.
INSTALLING DRUPAL.
I just pkg_add drupal-7.32.p1. Then I read the info in /usr/local/share/doc/pkg-readmes/drupal-7.32p1 telling me to symlink (symbolic link) the drupal7.conf and follow the database setup for PostgreSQL which is:
ln -sf /var/www/conf/modules.sample/drupal7.conf /var/www/conf/modules
createuser -U postgres --pwprompt --no-superuser --createdb --no-createrole drupal
createdb -U drupal -E UTF8 drupal
The "postgres" name is my PostgreSQL's admin name. There will be input request for password so I create a password, verify it and make sure I don't forget it. For drupal7.conf, I haven't touch anything, yet.
SETTING UP DRUPAL.
Webserver running? Check. PostgreSQL running? Check. Drupal running? Not yet. I tried putting "localhost/drupal7" and "127.0.0.1/drupal7" in the browser but both didn't work. I got Error 403 Forbidden. Ouch. I'm seriously lack of experience for this httpd and drupal stuff so I thought that maybe I need to install either Apache or Nginx (assuming that nobody done drupal with httpd yet). That's until I read a hint in www.drupal.org. So, I insert this in my browser:
http://localhost/drupal7/install.php
And wallah!, the Drupal installation page appears!. Yes! It's making progress. So I proceed with the installation as below:
Choose profile = Standard > Save and continue
Choose language = English (built-in) > Sane and continue
Verify requirements = all is ok except for "Unicode library = Error"
7th August: Ok. The error is about a deprecated function in PHP which must be disabled for Drupal's installation to continue. Yeah quite confusing. The exact error is:
| Unicode library | Error | |
| Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input setting. Please refer to the PHP mbstring documentationfor more information. | ||
I opened the PHP mbstring documentation but nothing can help me on this. So I google for tips and found that there's 2 ways to resolve this.
1) Add this lines in .htaccess in Drupal's web root (/var/www/htdocs/drupal7)
php_value mbstring.http_input pass
php_value mbstring.http_output pass
---- .htaccess end ----
I checked the Drupal's web root, but there's no .htacces file inside. I think this is related to Apache but just to make sure, I downloaded a sample .htacces file from www.drupal.org . Restarted the httpd, open the installation page and still have that error. So this is not working for me.
2) Add this line in ../drupal7/sites/default/setting.php
---- setting.php start ----
ini_set('mbstring.http_input', 'pass');
ini_set('mbstring.http_output', 'pass');
---- setting.php end ----
Restarted the httpd. And open the installation page and greeted by this warning message:
- Deprecated function: ini_set(): Use of mbstring.http_input is deprecated in include_once() (line 318 of /htdocs/drupal7/sites/default/settings.php).
- Deprecated function: ini_set(): Use of mbstring.http_output is deprecated in include_once() (line 319 of /htdocs/drupal7/sites/default/settings.php).
When I click Save and continue, this message appears in every page. But then the Verify requirement page passed successfully (although the warning is still there). So I'm now at the Set up database page.
Set up database:
Database = PostgreSQL
Database name* = drupal (the one I set before in PostgreSQL)
Database username* = drupal
Database password* = (the password I entered back then in PostgreSQL)
But now I'm in dilemma. I don't know if that "Deprecated function:" warning is harmless or not. I think I will search for more clue before I click on that "Save and continue" button.
Update 9th August: Searching on the net point me out to the most relevant issue stated in drupal's site at:
https://www.drupal.org/node/2332295
There's patch files listed on the top of that page and the most relevant one is the file:
drupal7-unicode_requirements-2332295-23.patch
That file will be patching /includes/unicode.inc file in the root Drupal's folder. I read the patch file, and compared with the current unicode.inc file and found that this is the correct patch. Now to patch it.
PATCHING DRUPAL
I downloaded the patch file, and move it to Drupal's root folder at /var/www/htdocs/drupal7 . Patching is something I rarely do so I refresh what I can by using man patch.
I need to test the patch first, to see if it's working as it's supposed to be. So I proceed with the testing command:
# sudo patch -C includes/unicode.inc drupal7-unicode_requirements-2332295-23.patch
Then the result came:
---- message snipped ----
Patching file includes/unicode.inc using Plan A...
Hunk #1 succeeded at 116.
done
Looks fine to me. So then I proceed with the actual patching:
# sudo patch includes/unicode.inc drupal7-unicode_requirements-2332295-23.patch
Done. Now to test the Drupal's installation. Just remember to delete/comment back both the "ini_set" lines I added in sites/default/settings.php. Restarted httpd and proceed with installation again.
INSTALLATION.
- Get browser to open http://127.0.0.1/drupal7/install.php
- Choose profile > Standard > Save and continue = passed
- Choose language > English (built-in) > Save and continue = passed
- Verify requirements = passed
- Set up database
> Database name = drupal
> Database username = drupal
> Database password = (same as when I set in PostgreSQL)
> Save and continue
Got this error:
In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider.
Failed to connect to your database server. The server reports the following message: SQLSTATE[08006] [7] could not translate host name "localhost" to address: no address associated with name.
- Is the database server running?
- Does the database exist, and have you entered the correct database name?
- Have you entered the correct username and password?
- Have you entered the correct database hostname?
Ok. I read that because httpd in OpenBSD is chrooted, I need to copy /etc/hosts and put it in /var/www/etc/. By default there's no etc/ folder in www so I need to mkdir it. Make sure that "hosts" file at least have this line:
127.0.0.1 localhost www.example.com
Now that should be it. Restarted httpd again and run throught the installation again.
- Set up database
> blablabla
> Save and continue = passed
- Install profile (it will take a moment = passed
- Configure site
> Site name* = default
> Site e-mail address* = noreply@example.com (can be changed)
> Username = karl
> E-mail address = (real email address)
> Password* = *********
> Confirm password* = *********
> Default country = Malaysia
> Default time zone = Asia/Kuala Lumpur
> Check for updates automatically = checked
> Received e-mail notifications = checked
> Save and continue = FINISHED!
Congratulations, I installed Drupal. Now to visit my local site.
Unfortunately, currently I can't use http://127.0.0.1/drupal7/ to visit my site (which if my httpd configured correctly, should be the correct address) but I can visit the site by using complete URL instead.
http://127.0.0.1/drupal7/index.html
For Drupal, all seems ok. I need to further test out and start exploring. For httpd issue above, I will also do the same. I will update on these issues when I found any tips. Enjoy the screenshot. Later.
UPDATE!: Bah although Drupal has been installed successfully, it's not functioning as it should. I have a feeling it's related to OpenBSD's httpd's setting. I would be grateful if someone can point me to relevant setting for this issue. Thanks in advance.
Update 10th August: Ok I have configured the /etc/httpd.conf file and now Drupal is working fine. Here's my configuration:
---- /etc/httpd.conf start ----
ext_addr="*"
server "default" {
listen on $ext_addr port 80
directory {
index "index.php"
}
location "*.php" {
fastcgi socket "/run/php-fpm.sock"
}
location "/cgi-bin/*" {
fastcgi
root "/"
}
root "/htdocs/drupal7"
}
---- /etc/httpd.conf end ----
Restarted the httpd server. Now when I type www.example.com or 127.0.0.1 or localhost in my browser, I can see the Drupal start page. I typed my Username and Password then I can see the site correctly. No more errors.
I've also posted a Hello World! entry to test it out. Enjoy the screenshot. Later.
Thursday, May 28, 2015
5.7 amd64 X200: Rotating random wallpaper using feh + cron. And more.
Hi,
Searching for rotating wallpaper on the web has given me a few good shell scripts to use. But what if I just want to use the good ol' crontab and feh? Here's what I've done.
What I'm on now:
- CWM
- feh
Obviously CWM is my WM of choice nowadays. And I've installed feh. My lappy's screen resolution is 1280x800 so I went searching for beautiful nature's wallpaper. Get more than 2 so I'll have many rotation choices.
For me, I mkdir a Wallpapers folder. So it's look like:
~/Wallpapers
I put all the pictures into that folder. Now for the cron part.
$ crontab -e
This is my first cron so the file is empty. I want this wallpaper to rotate using random picture every 5 minutes. So my cron is like this:
*/5 * * * * DISPLAY=:0.0 feh --bg-fill -z --no-fehbg ~/Wallpapers/
In short, human-readable meaning is every 5 minutes (*/5) the screen (DISPLAY=:0.0) will be used by feh to fill the picture as wallpaper (--bg-fill) randomly (-z) without writing a ~/.fehbg file (--no-fehbg) using pictures from the folder ~/Wallpapers .
Then press :WQ to write the changes and quit so the process will start. Enjoy the rotating wallpapers guys.
Ok. Now. What if I want to use random wallpapers everytime I log in to cwm? The command is the same like crontab there but I need to ready 2 things.
Editing ~/.xsession and put this line (before exec cwm or any WM of your choice).
eval `cat ~/.fehbg`
exec cwm
Searching for rotating wallpaper on the web has given me a few good shell scripts to use. But what if I just want to use the good ol' crontab and feh? Here's what I've done.
What I'm on now:
- CWM
- feh
Obviously CWM is my WM of choice nowadays. And I've installed feh. My lappy's screen resolution is 1280x800 so I went searching for beautiful nature's wallpaper. Get more than 2 so I'll have many rotation choices.
For me, I mkdir a Wallpapers folder. So it's look like:
~/Wallpapers
I put all the pictures into that folder. Now for the cron part.
$ crontab -e
This is my first cron so the file is empty. I want this wallpaper to rotate using random picture every 5 minutes. So my cron is like this:
*/5 * * * * DISPLAY=:0.0 feh --bg-fill -z --no-fehbg ~/Wallpapers/
In short, human-readable meaning is every 5 minutes (*/5) the screen (DISPLAY=:0.0) will be used by feh to fill the picture as wallpaper (--bg-fill) randomly (-z) without writing a ~/.fehbg file (--no-fehbg) using pictures from the folder ~/Wallpapers .
Then press :WQ to write the changes and quit so the process will start. Enjoy the rotating wallpapers guys.
Ok. Now. What if I want to use random wallpapers everytime I log in to cwm? The command is the same like crontab there but I need to ready 2 things.
Editing ~/.xsession and put this line (before exec cwm or any WM of your choice).
eval `cat ~/.fehbg`
exec cwm
Now create/edit ~/.fehbg and put the command like in crontab (without the DISPLAY=:0.0 bit):
feh --bg-fill -z --no-fehbg ~/Wallpapers/
And it's done. Oh wait, how about another one? Get a menu to change to a random wallpaper in cwm. Open up ~/.cwmrc and put this:
command ChangeWP "feh --bg-fill -z --no-fehbg ~/Wallpapers/"
Then refresh the cwm (by default should be pressing Ctrl+Alt+Shift+R) and click the menu.
Man crontab / feh for more info. Later.
Wednesday, May 27, 2015
5.7 amd64 X200: Downgraded back to 5.7-RELEASE but accidently clean installed.
Ouch,
This is one of those days. One of those days. I was having problem building libreoffice port in -current. Then found a latest snapshot, I upgraded to that latest snapshot but still having a problem building libreoffice. I didn't remember the exact error but it's related to GCC and lib-java or something similar.
I need to use libreoffice for my office works. So I thought on downgrading to 5.7-RELEASE. Downgraded I did. But failed miserably. I stupidly reinstall the -release. No. Cleanly installed. Yeah. I know. All my files are gone now.
My dotfiles, my data. Ouch. I mean a big OUCH. Yeah I know I should've kept my backup current. It's a stupid mistake on my side.
And now I will most probably start from (near) scratch. What I've learned?
1) Make sure the libreoffice is in packages for the -current version I want to upgrade as building libreoffice in port is a big pain in the butt.
2) Take backup seriously. I mean SERIOUSLY.
Later.
This is one of those days. One of those days. I was having problem building libreoffice port in -current. Then found a latest snapshot, I upgraded to that latest snapshot but still having a problem building libreoffice. I didn't remember the exact error but it's related to GCC and lib-java or something similar.
I need to use libreoffice for my office works. So I thought on downgrading to 5.7-RELEASE. Downgraded I did. But failed miserably. I stupidly reinstall the -release. No. Cleanly installed. Yeah. I know. All my files are gone now.
My dotfiles, my data. Ouch. I mean a big OUCH. Yeah I know I should've kept my backup current. It's a stupid mistake on my side.
And now I will most probably start from (near) scratch. What I've learned?
1) Make sure the libreoffice is in packages for the -current version I want to upgrade as building libreoffice in port is a big pain in the butt.
2) Take backup seriously. I mean SERIOUSLY.
Later.
Tuesday, May 26, 2015
5.7 amd64 X200: Creating / Using Easy2Boot installer for OpenBSD
Hi,
OpenBSD 5.7 is out and what am I gonna wait for? Ok now I'm running 5.7-CURRENT using snapshot, newly upgraded from 5.7-RELEASE but more on that later. Right now I want to share another good way to install OpenBSD using USB Drive.
If you read my Creating USB Flashdrive post, you may notice that the previous way will create a flashdrive installer solely for OpenBSD. It's a good option for a small capacity flashdrive, or for a big capacity flashdrives, if you want to store your favourite packages in it. But what if you wanted to make a multi OS installer flashdrive?
Why I wanted to have a multiboot flashdrive? Well, OpenBSD is not perfect. There's something that OpenBSD lack that other OS have. It is wider packages availability. There's a time that I wanted to install something and it's not yet available in OpenBSD. Be it lack of porter's interest and/or lack of resources to port it, there's that time that I need to use the specific application. Heck the only minus point for OpenBSD to me is less packages than GNU/Linux. And then I sometime have that sort of need to test other *BSD OS or GNU/Linux distro. That's why.
After a brief comparison of tools that I need to use, I choose Easy2Boot. I'm not going to write in details about setting up Easy2Boot. You can check their website for instructions. It's fairly easy to setup Easy2Boot as the installer will take care of almost everything IIRC.
What OSes I wanna put in there?
1) OpenBSD (of course!)
2) FreeBSD
3) Ubuntu Linux
4) Maybe UBCD or other tools
Again, I won't write in details about other things than OpenBSD. As Easy2Boot is Linux-friendly, there will be no problem preparing Linux distro for Easy2Boot. As for FreeBSD, you can check out Easy2Boot for FreeBSD section.
For OpenBSD, I tried using install57.iso and the result is:
Booting - booting is ok. Can go through (U)pgrade option but then Easy2Boot cannot mount the ISO file correctly so I cannot install the packages contained in it.
What's the option? I need to use the minimum installation ISO = cd57.iso. Easy2Boot can take care of booting up the minimal ISO and I can run the installation/upgrade process. Take note that I'm using Windows to prepare this.
1) Download cd57.iso from OpenBSD FTP site.
2) Rename the cd57.iso into some filename that easy to figure out. eg: OpenBSD57-AMD64.iso. Easy2Boot is very picky about "." (dot). Make sure to only have 1 dot only.
3) Move the ISO into the prepared Easy2Boot flashdrive:
/_ISO/MAINMENU/
4) Run the /MAKE_THIS_DRIVE_CONTIGUOUS.cmd inside the root folder of the flashdrive.
Ok the booting part is done. As the ISO is just a minimal boot, I need to get the base packages ready.
1) Go to the root flashdrive. eg: /
2) Create 5.7/amd64/ folder.
3) FTP into OpenBSD FTP site to download the base packages. For -RELEASE, it's ftp.openbsd.org/pub/OpenBSD/5.7/amd64/ .
4) Download all the bsd* , *tgz and optionally-but-recommended SHA256* files into the /5.7/amd64/ inside the flashdrive.
Done. Now, this method is more like the usual installation method, right? And who said that OpenBSD is hard?
For installation:
1) After Easy2Boot is booted, choose your OpenBSD ISO to boot OpenBSD image and do (U)pgrade.
2) When the installer ask for the packages, choose disk, then choose not mounted, and then choose sd1i (depending on your system).
3) Point your installer to the directory 5.7/amd64 inside the mounted sd1i.
4) If you created the folder correctly and put the files in there, the installer should list all the files needed to do the installation/upgrade.
5) Install/Upgrade!
Let the installation continues and reboot. After reboot, do sysmerge, the usual stuff. Starting from 5.7, the etcXX.tgz and xetcXX.tgz is now in base. So the sysmerge command is much simpler now.
# sysmerge
That's it. I've tried installing both OpenBSD and Ubuntu Linux using Easy2Boot and so far it's great. I haven't tried FreeBSD though. I hope you will find this useful. Later then.
OpenBSD 5.7 is out and what am I gonna wait for? Ok now I'm running 5.7-CURRENT using snapshot, newly upgraded from 5.7-RELEASE but more on that later. Right now I want to share another good way to install OpenBSD using USB Drive.
If you read my Creating USB Flashdrive post, you may notice that the previous way will create a flashdrive installer solely for OpenBSD. It's a good option for a small capacity flashdrive, or for a big capacity flashdrives, if you want to store your favourite packages in it. But what if you wanted to make a multi OS installer flashdrive?
Why I wanted to have a multiboot flashdrive? Well, OpenBSD is not perfect. There's something that OpenBSD lack that other OS have. It is wider packages availability. There's a time that I wanted to install something and it's not yet available in OpenBSD. Be it lack of porter's interest and/or lack of resources to port it, there's that time that I need to use the specific application. Heck the only minus point for OpenBSD to me is less packages than GNU/Linux. And then I sometime have that sort of need to test other *BSD OS or GNU/Linux distro. That's why.
After a brief comparison of tools that I need to use, I choose Easy2Boot. I'm not going to write in details about setting up Easy2Boot. You can check their website for instructions. It's fairly easy to setup Easy2Boot as the installer will take care of almost everything IIRC.
What OSes I wanna put in there?
1) OpenBSD (of course!)
2) FreeBSD
3) Ubuntu Linux
4) Maybe UBCD or other tools
Again, I won't write in details about other things than OpenBSD. As Easy2Boot is Linux-friendly, there will be no problem preparing Linux distro for Easy2Boot. As for FreeBSD, you can check out Easy2Boot for FreeBSD section.
For OpenBSD, I tried using install57.iso and the result is:
Booting - booting is ok. Can go through (U)pgrade option but then Easy2Boot cannot mount the ISO file correctly so I cannot install the packages contained in it.
What's the option? I need to use the minimum installation ISO = cd57.iso. Easy2Boot can take care of booting up the minimal ISO and I can run the installation/upgrade process. Take note that I'm using Windows to prepare this.
1) Download cd57.iso from OpenBSD FTP site.
2) Rename the cd57.iso into some filename that easy to figure out. eg: OpenBSD57-AMD64.iso. Easy2Boot is very picky about "." (dot). Make sure to only have 1 dot only.
3) Move the ISO into the prepared Easy2Boot flashdrive:
/_ISO/MAINMENU/
4) Run the /MAKE_THIS_DRIVE_CONTIGUOUS.cmd inside the root folder of the flashdrive.
Ok the booting part is done. As the ISO is just a minimal boot, I need to get the base packages ready.
1) Go to the root flashdrive. eg: /
2) Create 5.7/amd64/ folder.
3) FTP into OpenBSD FTP site to download the base packages. For -RELEASE, it's ftp.openbsd.org/pub/OpenBSD/5.7/amd64/ .
4) Download all the bsd* , *tgz and optionally-but-recommended SHA256* files into the /5.7/amd64/ inside the flashdrive.
Done. Now, this method is more like the usual installation method, right? And who said that OpenBSD is hard?
For installation:
1) After Easy2Boot is booted, choose your OpenBSD ISO to boot OpenBSD image and do (U)pgrade.
2) When the installer ask for the packages, choose disk, then choose not mounted, and then choose sd1i (depending on your system).
3) Point your installer to the directory 5.7/amd64 inside the mounted sd1i.
4) If you created the folder correctly and put the files in there, the installer should list all the files needed to do the installation/upgrade.
5) Install/Upgrade!
Let the installation continues and reboot. After reboot, do sysmerge, the usual stuff. Starting from 5.7, the etcXX.tgz and xetcXX.tgz is now in base. So the sysmerge command is much simpler now.
# sysmerge
That's it. I've tried installing both OpenBSD and Ubuntu Linux using Easy2Boot and so far it's great. I haven't tried FreeBSD though. I hope you will find this useful. Later then.
Saturday, April 11, 2015
5.6 AMD64 X200: Tryton ERP, "no module named stdnum" error when installing "bank" module.
Hey,
I'm currently trying out Tryton ERP, a fork of OpenERP which is now known as Odoo ERP. Both are open-source, although some would differ on which is more open-source than the other.
Anyway, I have a test "server" in my office now, although not much of a server as it's just an Intel Atom netbook but sufficient for my testing usage. Its role? Well I want it to be a testbed for database server, probably an ERP/CRM/HRM server the company I work at can use.
In that "server", I have Odoo installed. And in my lappy, I have Tryton installed. I like how Odoo (v8) have (in my opinion) a mature web ui, which currently Tryton don't (yes I know tryton have SAO). But that is somewhat a plus-point because I want the staff to use the web ui. Also Odoo's module can be installed via their web ui. Then their HR app is good.
Why didn't I install Odoo in my laptop too? Well, because Tryton is a fork of the same base ERP, and then Tryton is already in OpenBSD's package. Also there's quite convincing arguement from Tryton's dev on why their program is better (in term of coding, stability, security) from Odoo (or OpenERP as I read the comparison between Tryton vs Odoo/OpenERP v7 only). But Tryton's module installation is quite a hassle as you need to do pkg_add then import the installed module using trytond -i all -d "dbname".
Speaking of which, I was trying out some of the modules available for Tryton. I was a bit frustrated when on OpenBSD there's no trytond-module-all module so I can install all available module just in 1 go; but then this have it merits as I stumbled on an issue while installing the "trytond-module-bank" module.
pkg_add trytond-module-bank installation went fine. The problem arose when I tried to import the module using trytond -i all -d tryton32 (take note "tryton32" is my database name). I received this error message:
$ no module named stdnum
After searching for answer, I found that this module (trytond-module-bank) requires a python module called "python-stdnum" which is not the OpenBSD's package system. So I search for it using "pip".
$ sudo pip search stdnum
And there it is. "python-stdnum" module sitting there waiting for me to install it. And that's what I did.
$ sudo pip install python-stdnum
Installation went ok. Good. Then I proceed with importing the module in Tryton.
$ sudo trytond -i all -d tryton32
Success! Now I can continue experimenting with this great software.
Oh another thing. In /etc/trytond.conf, take note for these settings:
jsonrpc = localhost:8000
Make sure that if you're using Tryton client, the "hostname" is set to localhost, not the local IP Address (127.0.0.1) because I've done that and it won't connect.
Later then.
I'm currently trying out Tryton ERP, a fork of OpenERP which is now known as Odoo ERP. Both are open-source, although some would differ on which is more open-source than the other.
Anyway, I have a test "server" in my office now, although not much of a server as it's just an Intel Atom netbook but sufficient for my testing usage. Its role? Well I want it to be a testbed for database server, probably an ERP/CRM/HRM server the company I work at can use.
In that "server", I have Odoo installed. And in my lappy, I have Tryton installed. I like how Odoo (v8) have (in my opinion) a mature web ui, which currently Tryton don't (yes I know tryton have SAO). But that is somewhat a plus-point because I want the staff to use the web ui. Also Odoo's module can be installed via their web ui. Then their HR app is good.
Why didn't I install Odoo in my laptop too? Well, because Tryton is a fork of the same base ERP, and then Tryton is already in OpenBSD's package. Also there's quite convincing arguement from Tryton's dev on why their program is better (in term of coding, stability, security) from Odoo (or OpenERP as I read the comparison between Tryton vs Odoo/OpenERP v7 only). But Tryton's module installation is quite a hassle as you need to do pkg_add then import the installed module using trytond -i all -d "dbname".
Speaking of which, I was trying out some of the modules available for Tryton. I was a bit frustrated when on OpenBSD there's no trytond-module-all module so I can install all available module just in 1 go; but then this have it merits as I stumbled on an issue while installing the "trytond-module-bank" module.
pkg_add trytond-module-bank installation went fine. The problem arose when I tried to import the module using trytond -i all -d tryton32 (take note "tryton32" is my database name). I received this error message:
$ no module named stdnum
After searching for answer, I found that this module (trytond-module-bank) requires a python module called "python-stdnum" which is not the OpenBSD's package system. So I search for it using "pip".
$ sudo pip search stdnum
And there it is. "python-stdnum" module sitting there waiting for me to install it. And that's what I did.
$ sudo pip install python-stdnum
Installation went ok. Good. Then I proceed with importing the module in Tryton.
$ sudo trytond -i all -d tryton32
Success! Now I can continue experimenting with this great software.
Oh another thing. In /etc/trytond.conf, take note for these settings:
jsonrpc = localhost:8000
Make sure that if you're using Tryton client, the "hostname" is set to localhost, not the local IP Address (127.0.0.1) because I've done that and it won't connect.
Later then.
Friday, November 14, 2014
5.6 AMD64 X200: Using "Browser Back" & "Browser Next" keys in Xombrero.
Hi,
I was thinking of utilizing the "Browser Back" &"Browser Next" keys (located just above the "Left" & "Right" keys respectively) so that I can switch between previous and next open tabs in Xombrero browser.
So I start xev and after checking I found that the keysym for "Browser Back" is "XF86Back" and "Browser Next" is "XF86Forward". Good. Then I opened up ~/.xombrero.conf and add the keybindings such as:
keybinding = tabnext,XF86Forward
keybinding = tabprevious,XF86Back
I was thinking of utilizing the "Browser Back" &"Browser Next" keys (located just above the "Left" & "Right" keys respectively) so that I can switch between previous and next open tabs in Xombrero browser.
So I start xev and after checking I found that the keysym for "Browser Back" is "XF86Back" and "Browser Next" is "XF86Forward". Good. Then I opened up ~/.xombrero.conf and add the keybindings such as:
keybinding = tabnext,XF86Forward
keybinding = tabprevious,XF86Back
Then restart Xombrero. Good times. Later.
Monday, November 03, 2014
5.6 AMD64 X200: Update to 5.6! Package update problem and pkg_check to the rescue.
Hi,
I updated my X200 lappy to 5.6 today using the trusted upgrade using USB thumbdrive method. Upgrading went smooth until I done upgrading my packages.
Well, "done" isn't the correct word. I exited the pkg_add -u while it was updating my packages and I should've known that it will haunt me sooner or later. I re-run the pkg_add -u without realising that previous update wasn't done correctly. So I paid the price when I saw that GIMP, LibreOffice and GTK+2 can't be updated due to some libraries error. Something like:
Can't install gtk+2-2.24.24 because of libraries
| avahi-client.0.0 not found
| bla bla not found
I updated my X200 lappy to 5.6 today using the trusted upgrade using USB thumbdrive method. Upgrading went smooth until I done upgrading my packages.
Well, "done" isn't the correct word. I exited the pkg_add -u while it was updating my packages and I should've known that it will haunt me sooner or later. I re-run the pkg_add -u without realising that previous update wasn't done correctly. So I paid the price when I saw that GIMP, LibreOffice and GTK+2 can't be updated due to some libraries error. Something like:
Can't install gtk+2-2.24.24 because of libraries
| avahi-client.0.0 not found
| bla bla not found
Oh my. So what do I need to do now? The answer is:
pkg_check
This neat command checks the packages, dependencies and lots more. It's kind of interactive, so it will ask if problematic packages needs to be repaired or not, or like what I choose, [a]utomatic answer. Then it will do its job. And it does it well.
After it's done, I re-run pkg_add -u and all is ok. All updated correctly. Wallah!
Saturday, July 12, 2014
5.5 amd64 X200: Alpine S/MIME, finally managed to sign with CACert.
Hi,
I finally managed to get my Alpine to sign outgoing emails with Digital Certs from CACert.org, "community-driven Certificate Authority that issues certificates to the public at large for free."
If you're using Thunderbird, setting up Digital Signature is quite easy, just a matter of getting your personal Digital ID and importing it in Thunderbird. There's a few steps in detail but it's just a matter of a bit of adventure in the Thunderbird's Option window.
But if you're like me, who uses Alpine and would like to have the ability to sign with Digital Signature, there's quite a challenge. I've been stuck with this for some time, but as it's not a super-urgent thing, I took my time to solve this. So here I'm posting the steps needed to get my Alpine to sign my email with Digital Cert attained from CACert.org.
1) Register with CACert.org and create a personal Digital Cert.
This step is self-explanatory, go to http://www.cacert.org, register your own account and create your personal Digital Certificate. I don't want to pay for Digital Certificate offered by more trustworthy company so this is a great option for me.
2) Download the Digital Certificate from CACert.org and import in Firefox.
Ok for this, you will need to have Firefox. After you downloaded your Digital Certificate, you will need to open up Firefox, and in Edit > Preferences > Advanced > Certificates > View Certificates > Your Certificates, click on the Import button and import your Digital Cert.
3) Backup Digital Cert from Firefox in PKCS12 format.
From Edit > Preferences > Advanced > Certificates > View Certificates > Your Certificates, choose the Digital Cert you want to use and then click the Backup button. You will need to create a password for it. Remember to save it at pkcs12 format. For example, save it as karl@mail.com.p12.
4) Create PEM format from the PKCS12 file.
Open your xterm, and create a PEM file from the PKCS12 (*.p12) file you just backed up.
$ openssl pkcs12 -in karl@mail.com.p12 -out karl.@mail.com.pem
Now the newly created karl@mail.com.pem file can be edited with vi or any text editor you use.
5) Create CRT and KEY file for Alpine use.
Some people suggested to use openssl to create CRT and KEY file. I didn't managed to do this successfully using the openssl method, and the result is that my Alpine gave out "Couldn't find the certificate needed to sign." prompt when I try to sign my outgoing emails. So I went with the manual way.
Remember that the PEM format is plain text and editable? So I vi the karl@mail.com.pem file. I can see there's 3 section there. The top part is something like this:
Bag Attributes
*snipped*
-----BEGIN ENCRYPTED PRIVATE KEY-----
*blablabla*
I finally managed to get my Alpine to sign outgoing emails with Digital Certs from CACert.org, "community-driven Certificate Authority that issues certificates to the public at large for free."
If you're using Thunderbird, setting up Digital Signature is quite easy, just a matter of getting your personal Digital ID and importing it in Thunderbird. There's a few steps in detail but it's just a matter of a bit of adventure in the Thunderbird's Option window.
But if you're like me, who uses Alpine and would like to have the ability to sign with Digital Signature, there's quite a challenge. I've been stuck with this for some time, but as it's not a super-urgent thing, I took my time to solve this. So here I'm posting the steps needed to get my Alpine to sign my email with Digital Cert attained from CACert.org.
1) Register with CACert.org and create a personal Digital Cert.
This step is self-explanatory, go to http://www.cacert.org, register your own account and create your personal Digital Certificate. I don't want to pay for Digital Certificate offered by more trustworthy company so this is a great option for me.
2) Download the Digital Certificate from CACert.org and import in Firefox.
Ok for this, you will need to have Firefox. After you downloaded your Digital Certificate, you will need to open up Firefox, and in Edit > Preferences > Advanced > Certificates > View Certificates > Your Certificates, click on the Import button and import your Digital Cert.
3) Backup Digital Cert from Firefox in PKCS12 format.
From Edit > Preferences > Advanced > Certificates > View Certificates > Your Certificates, choose the Digital Cert you want to use and then click the Backup button. You will need to create a password for it. Remember to save it at pkcs12 format. For example, save it as karl@mail.com.p12.
4) Create PEM format from the PKCS12 file.
Open your xterm, and create a PEM file from the PKCS12 (*.p12) file you just backed up.
$ openssl pkcs12 -in karl@mail.com.p12 -out karl.@mail.com.pem
Now the newly created karl@mail.com.pem file can be edited with vi or any text editor you use.
5) Create CRT and KEY file for Alpine use.
Some people suggested to use openssl to create CRT and KEY file. I didn't managed to do this successfully using the openssl method, and the result is that my Alpine gave out "Couldn't find the certificate needed to sign." prompt when I try to sign my outgoing emails. So I went with the manual way.
Remember that the PEM format is plain text and editable? So I vi the karl@mail.com.pem file. I can see there's 3 section there. The top part is something like this:
Bag Attributes
*snipped*
-----BEGIN ENCRYPTED PRIVATE KEY-----
*blablabla*
That top portion is the private key. Delete everything before the:
-----BEGIN ENCRYPTED PRIVATE KEY-----
and delete everything after the:
-----END ENCRYPTED PRIVATE KEY-----
then save it to something as karl@mail.com.key. Remember, this is your private key. And don't overwrite the original file you've edited.
Open the karl@mail.com.pem file again. You would see the just below the private key portion, there's something like:
Bag Attributes
friendlyName: CAcert.org Class 1 Certification Authority
*snipped*
-----BEGIN CERTIFICATE-----
Now this is you Certificate Issuer portion. I edited the file and deleted everything before the immediate:
-----BEGIN CERTIFICATE-----
and deleted everything after the immediate:
-----END CERTIFICATE-----
then save the file as cacert.org.crt. Do take note that this file could be named as anything but make sure the filename ends with ".crt".
Open the PEM file again, and the 3rd portion is you public key. The "Bag Attributes" details should contain your email address you created the Digital Cert with. So I deleted everything before the:
-----BEGIN CERTIFICATE-----
then save the file to something as karl@mail.com.crt.
6) Setup Alpine to use the karl@mail.com.key Digital Cert.
By default, Alpine needs ~/.alpine-smime directory to store the Digital Certs. But in my case, it didn't exits. So I mkdir these directories:
~/.alpine-smime/ca
~/.alpine-smime/public
~/.alpine-smime/private
Then move all your *crt & *.key files to the correct directory such as:
~/.alpine-smime/ca/cacert.org.crt
~/.alpine-smime/public/karl@mail.com.crt
~/.alpine-smime/private/karl@mail.com.key
That should be it. In Alpine, I use Roles so the From address is the same as my Digital Cert so Alpine can Digitally sign the email composed. So far signing email is ok but I haven't tested the encryption. Later.
References.
- http://www.cacert.org
- http://comments.gmane.org/gmane.mail.alpine.info/4969
- Roles in Alpine
- Alpine S/MIME - http://patches.freeiz.com/alpine/alpine-info/misc/smime.html
5.5 amd64 X200: Firefox always crashing? Then try raising datasize.
Heyya,
My Firefox crashed sometime. Been like this since forever I think. Didn't bother to look at it until a few days ago when I think "hey I commonly sees this crashing but why other didn't flame the net about it?". So I went out to search for answers.
Then I found that this is not application or OpenBSD issue, but rather limited default setting. Firefox is quite a resource hog and by default, the datasize limit is set for 512Mb, which is by Firefox, quite low.
So I edited /etc/login.conf and find the default setting like below:
default:\
*snipped*
:datasize-max=512M:\
:datasize-cur=512M:\
*snipped*
My Firefox crashed sometime. Been like this since forever I think. Didn't bother to look at it until a few days ago when I think "hey I commonly sees this crashing but why other didn't flame the net about it?". So I went out to search for answers.
Then I found that this is not application or OpenBSD issue, but rather limited default setting. Firefox is quite a resource hog and by default, the datasize limit is set for 512Mb, which is by Firefox, quite low.
So I edited /etc/login.conf and find the default setting like below:
default:\
*snipped*
:datasize-max=512M:\
:datasize-cur=512M:\
*snipped*
and changed the value to:
default:\
*snipped*
:datasize-max=2048M:\
:datasize-cur=1024M:\
*snipped*
As I have about 4Gb of ram, this setting should be ok. So far this setting is ok and Firefox haven't crashed yet. Later.
References:
- man login.conf
- http://daemonforums.org/showthread.php?t=7894
Monday, November 04, 2013
5.4 amd64 X200: Now on 5.4! VIM-python not updated.
Hey,
I've just upgraded my X200 to 5.4. On first reboot, I noticed the framebuffer console. Wow. Nice. Finally we have this.
I've updated all my installed packages except for VIM. Something is wrong with the update. I installed my VIM via ports last time because I need the python flavor. Starting VIM also give error.
After the failed attempt to update via pkg_add, so I uninstalled it and tried to install it via ports. Also failed becuase of library bad major issue. Ouch.
Then I remembered that I haven't updated by port tree yet. Sheesh.
# cd /usr/ports
# cvs -d anoncvs@server.openbsd.org:/cvs update -Pd -rOPENBSD_5_4
I've just upgraded my X200 to 5.4. On first reboot, I noticed the framebuffer console. Wow. Nice. Finally we have this.
I've updated all my installed packages except for VIM. Something is wrong with the update. I installed my VIM via ports last time because I need the python flavor. Starting VIM also give error.
After the failed attempt to update via pkg_add, so I uninstalled it and tried to install it via ports. Also failed becuase of library bad major issue. Ouch.
Then I remembered that I haven't updated by port tree yet. Sheesh.
# cd /usr/ports
# cvs -d anoncvs@server.openbsd.org:/cvs update -Pd -rOPENBSD_5_4
Let em updated. And then install the VIM back.
# cd /usr/ports/editor/vim
# env FLAVOR="gtk2 python" make install clean
Wallah! Now it's nice and dandy.
Friday, October 18, 2013
5.3 amd64 X200: MP3 file not detected in ncmpcpp / mpd / mpc.
Hi,
I have collections of mp3 audio in my lappy. Nowadays, instead of mplayer which I use specifically for videos, I use mpd. For the frontend, I use ncmpcpp which is a curse-based console, uh, GUI(?). I has many great features which you can refer to from the link I've given.
Ok, there's a collection of mp3s I'm currently listening to. Around 114 files. Then I realised that a few files is not listed in ncmpcpp even when I tried (U)pdating the file browser. When I do ls in the directory, the file is there. I can play the file using mplayer.
I tried using mpc, command line for mpd but I still cannot list the file.
Fearing that I may have a corrupted mp3 file, I was prepared to download that hundred Mbs worth of files when I saw this:
$ ls -lh
-rw-r--r-- Audio_that_is_ok.mp3
-rw-r--r-- Audio_that_is_ok_2.mp3
-rw------- Audio_that_is_not_detected.mp3
-rw-r--r-- Audio_that_is_ok_3.mp3
*ting!*. Ohhhh. That's the reason. Ahah! That files is set to (r)ead/(w)rite for me only. So I chmod 644 the affected files and after (u)pdating my ncmpcpp, all is well.
Sometime we overlooked the simplest thing. Oh ok maybe just me. Later.
I have collections of mp3 audio in my lappy. Nowadays, instead of mplayer which I use specifically for videos, I use mpd. For the frontend, I use ncmpcpp which is a curse-based console, uh, GUI(?). I has many great features which you can refer to from the link I've given.
Ok, there's a collection of mp3s I'm currently listening to. Around 114 files. Then I realised that a few files is not listed in ncmpcpp even when I tried (U)pdating the file browser. When I do ls in the directory, the file is there. I can play the file using mplayer.
I tried using mpc, command line for mpd but I still cannot list the file.
Fearing that I may have a corrupted mp3 file, I was prepared to download that hundred Mbs worth of files when I saw this:
$ ls -lh
-rw-r--r-- Audio_that_is_ok.mp3
-rw-r--r-- Audio_that_is_ok_2.mp3
-rw------- Audio_that_is_not_detected.mp3
-rw-r--r-- Audio_that_is_ok_3.mp3
*ting!*. Ohhhh. That's the reason. Ahah! That files is set to (r)ead/(w)rite for me only. So I chmod 644 the affected files and after (u)pdating my ncmpcpp, all is well.
Sometime we overlooked the simplest thing. Oh ok maybe just me. Later.
Wednesday, May 29, 2013
5.3 amd64 X200: Upgrading OpenBSD using USB Flashdrive.
Hey,
This is related to Creating USB Flashdrive installer. I posted previously. I have another OpenBSD machine in my office, not that the company requires it but as it's my machine, I installed whatever I want. The machine is still on 5.2, so this is a good chance to test my shiny USB Flashdrive installer.
If your machine is just like mine, which support USB Booting, I just boot from USB Flashdrive. Bolded is my input.
Welcome to the OpenBSD/amd64 5.3 installation program.
(I)nstall, (U)pgrade or (S)hell? u
Available disks are: sd0 sd1.
Which disk is the root disk? ('?' for details) [sd0] ?
sd0: ST9160823AS (149.1G)
sd1: DataTraveler 2.0 (1.9G)
As you can see it asked for the root disk. Which is the disk I want to upgrade. I choose ? to check which device is for my primary disk and which is for the USB Flashdrive. As you can see, sd1 is my Kingston DataTraveler USB Flashdrive. So then I just press ENTER for the default choice [sd0] for the root disk.
Let's upgrade the sets!
Location of sets? (cd disk ftp http or 'done') [cd] disk
Remember the sets are in the USB Flashdrive so I need to set the location correctly. So I choose disk.
Is the disk partition already mounted? [no] ENTER
Available disks are: sd0 sd1.
Which one contains the upgrade media? (or 'done') [sd1] ENTER
a: 1228768 64 4.2BSD 2048 16384 1
i: 2658867 1228863 MSDOS
Available sd1 partitions are: a i.
Which one has the upgrade sets? (or 'done') [a] Enter
Pathname to the sets? (or 'done') [5.3/amd64] 5.3
The sd1 is not mounted, so I need to answer accordingly. I then choose sd1 and then the a partition (remember sd1a is for OpenBSD, sd1i is for MSDOS). My 5.3 sets is in sd1a/5.3/ so I just input the directory name 5.3.
Select sets by entering a set name, a file name pattern or 'all'. De-select sets by prepending a '-' to the set name, file name pattern or 'all'. Selected sets are labelled '[X]'.
Now I can see the list of sets I have in the 5.3 directory. Continue to upgrade as usual. After it's upgraded, I rebooted the machine to change the timezone, then mount the USB Flashdrive again to do sysmerge. The usual stuff.
Installation via USB Flashdrive is FAST! Later.
This is related to Creating USB Flashdrive installer. I posted previously. I have another OpenBSD machine in my office, not that the company requires it but as it's my machine, I installed whatever I want. The machine is still on 5.2, so this is a good chance to test my shiny USB Flashdrive installer.
If your machine is just like mine, which support USB Booting, I just boot from USB Flashdrive. Bolded is my input.
Welcome to the OpenBSD/amd64 5.3 installation program.
(I)nstall, (U)pgrade or (S)hell? u
Available disks are: sd0 sd1.
Which disk is the root disk? ('?' for details) [sd0] ?
sd0: ST9160823AS (149.1G)
sd1: DataTraveler 2.0 (1.9G)
As you can see it asked for the root disk. Which is the disk I want to upgrade. I choose ? to check which device is for my primary disk and which is for the USB Flashdrive. As you can see, sd1 is my Kingston DataTraveler USB Flashdrive. So then I just press ENTER for the default choice [sd0] for the root disk.
Let's upgrade the sets!
Location of sets? (cd disk ftp http or 'done') [cd] disk
Remember the sets are in the USB Flashdrive so I need to set the location correctly. So I choose disk.
Is the disk partition already mounted? [no] ENTER
Available disks are: sd0 sd1.
Which one contains the upgrade media? (or 'done') [sd1] ENTER
a: 1228768 64 4.2BSD 2048 16384 1
i: 2658867 1228863 MSDOS
Available sd1 partitions are: a i.
Which one has the upgrade sets? (or 'done') [a] Enter
Pathname to the sets? (or 'done') [5.3/amd64] 5.3
The sd1 is not mounted, so I need to answer accordingly. I then choose sd1 and then the a partition (remember sd1a is for OpenBSD, sd1i is for MSDOS). My 5.3 sets is in sd1a/5.3/ so I just input the directory name 5.3.
Select sets by entering a set name, a file name pattern or 'all'. De-select sets by prepending a '-' to the set name, file name pattern or 'all'. Selected sets are labelled '[X]'.
Now I can see the list of sets I have in the 5.3 directory. Continue to upgrade as usual. After it's upgraded, I rebooted the machine to change the timezone, then mount the USB Flashdrive again to do sysmerge. The usual stuff.
Installation via USB Flashdrive is FAST! Later.
Subscribe to:
Posts (Atom)
6.5 amd64: Modify existing certbot certificates.
Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...
-
Firstly, yeah I changed the blog's title. As I'm using ONLY OpenBSD nowadays, I think it's appropriate to change the title as I...
-
Ah. Now I'm back to using xdm as my login manager. Using Wikibook's Guide to X11 as a guideline, I managed to write a rough hack to...
-
Hi, OpenBSD 5.7 is out and what am I gonna wait for? Ok now I'm running 5.7-CURRENT using snapshot, newly upgraded from 5.7-RELEASE b...



