Commit 6e8191bc authored by Patipat Jo's avatar Patipat Jo
Browse files

Update from-source.md

parent 33b5f3bf
......@@ -7,7 +7,7 @@ sudo apt-get update
### 2. ติดตั้ง Package ของ Ubuntu ที่ CKAN ต้องการ:
```sh
sudo apt-get install libpython2.7 libpq5 python-pip python-virtualenv git-core solr-jetty openjdk-8-jdk redis-server
sudo apt-get install libpq5 redis-server libpython2.7 python-pip git-core
```
### 3. ตั้งค่า python2 และ pip2:
......@@ -75,56 +75,38 @@ deactivate
### 7. ติดตั้งและตั้งค่า Solr:
```sh
sudo useradd --user-group --shell /bin/false --home-dir /opt/jetty/temp jetty
sudo apt-get install openjdk-8-jdk
sudo apt-get install -y solr-jetty
# ใช้คำสั่งนี้เพื่อให้เปลี่ยนไปใช้ openjdk-8-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
sudo mkdir /etc/systemd/system/jetty9.service.d
wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz
sudo vi /etc/systemd/system/jetty9.service.d/solr.conf
[Service]
ReadWritePaths=/var/lib/solr
tar xzf solr-6.5.1.tgz solr-6.5.1/bin/install_solr_service.sh --strip-components=2
sudo vi /etc/jetty9/start.ini
jetty.host=127.0.0.1
jetty.port=8983
```
```sh
sudo vi /etc/solr/solr-jetty.xml
sudo bash ./install_solr_service.sh solr-6.5.1.tgz
#แก้ไข solr-jetty.xml ตามนี้
sudo su solr
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
cd /opt/solr/bin
<!-- Context configuration file for the Solr web application in Jetty -->
./solr create -c ckan
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/solr</Set>
<Set name="war">/usr/share/solr/web</Set>
cd /var/solr/data/ckan/conf
<!-- Set the solr.solr.home system property -->
<Call name="setProperty" class="java.lang.System">
<Arg type="String">solr.solr.home</Arg>
<Arg type="String">/usr/share/solr</Arg>
</Call>
sed -i '/<config>/a <schemaFactory class="ClassicIndexSchemaFactory"/>' solrconfig.xml
<!-- Enable symlinks -->
<!--<Call name="addAliasCheck">
<Arg>
<New class="org.eclipse.jetty.server.handler.ContextHandler$ApproveSameSuffixAliases"/>
</Arg>
</Call>-->
</Configure>
```
```sh
sudo mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.xml.bak
sed -i '/<initParams path="\/update\/\*\*">/,/<\/initParams>/ s/.*/<!--&-->/' solrconfig.xml
sed -i '/<processor class="solr.AddSchemaFieldsUpdateProcessorFactory">/,/<\/processor>/ s/.*/<!--&-->/' solrconfig.xml
rm managed-schema
sudo ln -s /usr/lib/ckan/default/src/ckan/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml
ln -s /usr/lib/ckan/default/src/ckan/ckan/config/solr/schema.xml schema.xml
sudo systemctl daemon-reload
exit
sudo service jetty9 restart
sudo service solr restart
```
### 8. ตั้งค่าและสร้างฐานข้อมูลสำหรับ CKAN
......@@ -160,8 +142,8 @@ sudo vi /etc/ckan/default/ckan.ini
> ckan.auth.user_delete_organizations = false
- แก้ไข ckan.auth.public_user_details
> ckan.auth.public_user_details = false
- เปิดการใช้งาน solr_url
> solr_url = http://127.0.0.1:8983/solr
- เปิดการใช้งาน และแก้ไข solr_url
> solr_url = http://127.0.0.1:8983/solr/ckan
- เปิดการใช้งาน ckan.redis.url
> ckan.redis.url = redis://localhost:6379/0
- แก้ไข ckan.plugins (ให้เหมือนตามนี้)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment